From 0e6c996cf413491d355d067a0078d142fc42ce2b Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 5 Oct 2023 15:23:58 +0300 Subject: [PATCH] fix 500 error --- files/routes/comments.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 0a213c39b..327a8fa0d 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -374,10 +374,12 @@ def comment(v): if parent_user.id != v.id and notify_op: notify_users.add(parent_user.id) + notify_users -= BOT_IDs + if v.shadowbanned: notify_users = [x[0] for x in g.db.query(User.id).filter(User.id.in_(notify_users), User.admin_level >= PERMS['USER_SHADOWBAN']).all()] - for x in notify_users-BOT_IDs: + for x in notify_users: n = Notification(comment_id=c.id, user_id=x) g.db.add(n) @@ -727,10 +729,12 @@ def edit_comment(cid, v): if notify_users == 'everyone': alert_everyone(c.id) else: + notify_users -= BOT_IDs + if v.shadowbanned: notify_users = [x[0] for x in g.db.query(User.id).filter(User.id.in_(notify_users), User.admin_level >= PERMS['USER_SHADOWBAN']).all()] - for x in notify_users-BOT_IDs: + for x in notify_users: notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=x).one_or_none() if not notif: n = Notification(comment_id=c.id, user_id=x)