From 99a3aba57874002bfd80c90ffcd6f65986842e04 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 5 Oct 2023 10:38:35 +0300 Subject: [PATCH] fix notifs --- files/helpers/alerts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index e406a3e38..0d5bd846c 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -31,7 +31,7 @@ def create_comment(text_html): def send_repeatable_notification(uid, text): if uid in BOT_IDs: return - if not (hasattr(g, 'v') and g.v and g.v.shadowbanned) or g.db.query(User.admin_level).filter_by(id=uid).one()[0] >= PERMS['USER_SHADOWBAN']: + if hasattr(g, 'v') and g.v and g.v.shadowbanned and g.db.query(User.admin_level).filter_by(id=uid).one()[0] < PERMS['USER_SHADOWBAN']: return text_html = sanitize(text, blackjack="notification") @@ -57,7 +57,7 @@ def send_repeatable_notification(uid, text): def send_notification(uid, text): if uid in BOT_IDs: return - if not (hasattr(g, 'v') and g.v and g.v.shadowbanned) or g.db.query(User.admin_level).filter_by(id=uid).one()[0] >= PERMS['USER_SHADOWBAN']: + if hasattr(g, 'v') and g.v and g.v.shadowbanned and g.db.query(User.admin_level).filter_by(id=uid).one()[0] < PERMS['USER_SHADOWBAN']: return cid = notif_comment(text)