From 48da547fb8ab2608ad1f4af01bb6de679bdce26d Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 14 Aug 2023 22:57:24 +0300 Subject: [PATCH] fix this https://watchpeopledie.tv/h/meta/post/27855/hidden-thread-for-viewing-notifications/1443770#context --- files/routes/comments.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index ccfba99d6f..a3dfc7dd10 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()):