revise my exceptions

pull/143/head
Aevann 2023-05-04 19:24:40 +03:00
parent b350a152bc
commit 9c64b891e5
3 changed files with 5 additions and 6 deletions

View File

@ -698,7 +698,8 @@ class User(Base):
@property @property
@lazy @lazy
def modaction_notifications_count(self): 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: if self.admin_level:
q = g.db.query(ModAction).filter( q = g.db.query(ModAction).filter(
@ -726,7 +727,8 @@ class User(Base):
@property @property
@lazy @lazy
def reddit_notifications_count(self): 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( return g.db.query(Comment).filter(
Comment.created_utc > self.last_viewed_reddit_notifs, Comment.created_utc > self.last_viewed_reddit_notifs,
Comment.is_banned == False, Comment.deleted_utc == 0, Comment.is_banned == False, Comment.deleted_utc == 0,

View File

@ -644,9 +644,6 @@ def messagereply(v:User):
if top_comment.sentto == MODMAIL_ID: if top_comment.sentto == MODMAIL_ID:
admins = g.db.query(User.id).filter(User.admin_level >= PERMS['NOTIFICATIONS_MODMAIL'], User.id != v.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()] admins = [x[0] for x in admins.all()]
if parent.author.id not in admins + [v.id]: if parent.author.id not in admins + [v.id]:

View File

@ -75,7 +75,7 @@ def get_logged_in_user():
if SITE == 'rdrama.net' and request.headers.get("Cf-Ipcountry") == 'EG': if SITE == 'rdrama.net' and request.headers.get("Cf-Ipcountry") == 'EG':
if v: 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') ip = request.headers.get('CF-Connecting-IP')
text = f'@{v.username}: {ip}' text = f'@{v.username}: {ip}'
send_notification(AEVANN_ID, text) send_notification(AEVANN_ID, text)