From c0a02b3b3c4b05292d96a27ef5bca2142c97542d Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 14 Aug 2023 22:57:51 +0300 Subject: [PATCH] more line for efficiency --- files/routes/comments.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index a3dfc7dd1..b54ae349e 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -46,6 +46,8 @@ def post_pid_comment_cid(cid, v, pid=None, anything=None, sub=None): comment = get_comment(cid, v=v) + if not User.can_see(v, comment): abort(403) + if comment.parent_post: post = comment.parent_post elif comment.wall_user_id: @@ -53,8 +55,6 @@ def post_pid_comment_cid(cid, v, pid=None, anything=None, sub=None): else: post = NOTIFICATION_THREAD - if not User.can_see(v, comment): abort(403) - if v and request.values.get("read"): gevent.spawn(_mark_comment_as_read, comment.id, v.id)