From c62db24d5f472dc430a729d57d9c812458340003 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 6 Jun 2024 21:34:27 +0300 Subject: [PATCH] fix !everyone --- files/routes/comments.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 32525a9c2..a266db231 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -339,6 +339,14 @@ def comment(v): n = Notification(comment_id=c.id, user_id=x) g.db.add(n) + if c.level >= 3 and c.parent_comment.author_id in notify_users: + n = g.db.query(Notification).filter_by( + comment_id=c.parent_comment.parent_comment_id, + user_id=c.parent_comment.author_id, + read=True, + ).one_or_none() + if n: g.db.delete(n) + vote = CommentVote(user_id=v.id, comment_id=c.id, vote_type=1, @@ -363,14 +371,6 @@ def comment(v): post_target.bump_utc = c.created_utc g.db.add(post_target) - if c.level >= 3 and c.parent_comment.author_id in notify_users: - n = g.db.query(Notification).filter_by( - comment_id=c.parent_comment.parent_comment_id, - user_id=c.parent_comment.author_id, - read=True, - ).one_or_none() - if n: g.db.delete(n) - g.db.flush() if c.parent_post: