From 9c64b891e5ba6b7479743a59a0090b5a9f8b8bcd Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 4 May 2023 19:24:40 +0300 Subject: [PATCH] revise my exceptions --- files/classes/user.py | 6 ++++-- files/routes/users.py | 3 --- files/routes/wrappers.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 23cb4b1bd..92ef42920 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -698,7 +698,8 @@ class User(Base): @property @lazy def modaction_notifications_count(self): - if self.id == AEVANN_ID and SITE_NAME != 'rDrama': return 0 + if self.id == AEVANN_ID and SITE_NAME != 'rDrama': + return 0 if self.admin_level: q = g.db.query(ModAction).filter( @@ -726,7 +727,8 @@ class User(Base): @property @lazy def reddit_notifications_count(self): - if not self.can_view_offsitementions or self.id == AEVANN_ID: return 0 + if not self.can_view_offsitementions: + return 0 return g.db.query(Comment).filter( Comment.created_utc > self.last_viewed_reddit_notifs, Comment.is_banned == False, Comment.deleted_utc == 0, diff --git a/files/routes/users.py b/files/routes/users.py index a0fb96750..bb644ac06 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -644,9 +644,6 @@ def messagereply(v:User): if top_comment.sentto == MODMAIL_ID: admins = g.db.query(User.id).filter(User.admin_level >= PERMS['NOTIFICATIONS_MODMAIL'], User.id != v.id) - if SITE == 'rdrama.net': - admins = admins.filter(User.id != AEVANN_ID) - admins = [x[0] for x in admins.all()] if parent.author.id not in admins + [v.id]: diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index a5f5b7622..6ab04d30c 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -75,7 +75,7 @@ def get_logged_in_user(): if SITE == 'rdrama.net' and request.headers.get("Cf-Ipcountry") == 'EG': if v: - if v.id != AEVANN_ID and not v.username.startswith('Aev'): + if v.id != AEVANN_ID: ip = request.headers.get('CF-Connecting-IP') text = f'@{v.username}: {ip}' send_notification(AEVANN_ID, text)