fix 500 error

pull/83/head
Aevann 2023-01-01 17:44:37 +02:00
parent 7370e47735
commit 4e24336a66
1 changed files with 5 additions and 1 deletions

View File

@ -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.")