From 4e24336a6619c14d83c05e33c684bb23629eda82 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 1 Jan 2023 17:44:37 +0200 Subject: [PATCH] fix 500 error --- files/routes/comments.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 5258670c98..47f14d6dce 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -42,7 +42,11 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None): g.db.add(notif) g.db.commit() - post = comment.post + if comment.parent_submission: + post = comment.post + else: + post = get_post(NOTIFICATION_THREAD, v=v) + if post.over_18 and not (v and v.over_18) and not session.get('over_18', 0) >= int(time.time()): if v and v.client: abort(403, "This content is not suitable for some users and situations.")