diff --git a/files/routes/comments.py b/files/routes/comments.py index ccfba99d6..a3dfc7dd1 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -45,16 +45,19 @@ def _mark_comment_as_read(cid, vid): def post_pid_comment_cid(cid, v, pid=None, anything=None, sub=None): comment = get_comment(cid, v=v) + + if comment.parent_post: + post = comment.parent_post + elif comment.wall_user_id: + return redirect(f"/id/{comment.wall_user_id}/wall/comment/{comment.id}") + 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) - if comment.parent_post: - post = comment.parent_post - else: - post = NOTIFICATION_THREAD - post = get_post(post, v=v) if not (v and v.client) and post.over_18 and not (v and v.over_18) and not session.get('over_18_cookies', 0) >= int(time.time()):