From 890fedf1f3194ae4eeeb101ca89bf3212a4c82c3 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 26 Feb 2023 11:14:39 +0200 Subject: [PATCH] remove redundant condition --- files/classes/user.py | 2 +- files/routes/notifications.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 6bd433885..75c145c50 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -594,7 +594,7 @@ class User(Base): .filter( Notification.read == False, Notification.user_id == self.id, - not_(and_(Comment.sentto != None, Comment.sentto == MODMAIL_ID, User.is_muted)), + not_(and_(Comment.sentto == MODMAIL_ID, User.is_muted)), )) if not self.can_see_shadowbanned: diff --git a/files/routes/notifications.py b/files/routes/notifications.py index 994c723c3..fb1efb996 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -298,7 +298,7 @@ def notifications(v:User): comments = g.db.query(Comment, Notification).join(Notification.comment).join(Comment.author).filter( Notification.user_id == v.id, or_(Comment.sentto == None, Comment.sentto == MODMAIL_ID), - not_(and_(Comment.sentto != None, Comment.sentto == MODMAIL_ID, User.is_muted)), + not_(and_(Comment.sentto == MODMAIL_ID, User.is_muted)), ) if v.admin_level < PERMS['USER_SHADOWBAN']: