From ffa04a3cd549b48c27b2849fca76c33f143c1c6c Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 27 Jan 2023 10:18:05 +0200 Subject: [PATCH] constantify my log action types --- files/classes/user.py | 2 +- files/helpers/config/modaction_types.py | 3 +++ files/routes/notifications.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 842c8c1d7..d47942518 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -651,7 +651,7 @@ class User(Base): ModAction.user_id != self.id, ) if self.id == AEVANN_ID: - q = q.filter(ModAction.kind.in_(('ban_user','shadowban'))) + q = q.filter(ModAction.kind.in_(AEVANN_MODACTION_TYPES)) if self.admin_level < PERMS['PROGSTACK']: q = q.filter(ModAction.kind.notin_(MODACTION_PRIVILEGED__TYPES)) diff --git a/files/helpers/config/modaction_types.py b/files/helpers/config/modaction_types.py index 1bb85322b..09cf48891 100644 --- a/files/helpers/config/modaction_types.py +++ b/files/helpers/config/modaction_types.py @@ -372,3 +372,6 @@ MODACTION_TYPES_FILTERED = deepcopy({t:v for t,v in MODACTION_TYPES.items() if not t in MODACTION_PRIVILEGED_TYPES}) MODACTION_TYPES__FILTERED = deepcopy({t:v for t,v in MODACTION_TYPES.items() if not t in MODACTION_PRIVILEGED__TYPES}) +AEVANN_MODACTION_TYPES = {'ban_user','unban_user', + 'shadowban','unshadowban', + 'progstack_post','progstack_comment'} diff --git a/files/routes/notifications.py b/files/routes/notifications.py index a90693456..a0305d222 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -198,7 +198,7 @@ def notifications_modactions(v:User): listing = g.db.query(cls).filter(cls.user_id != v.id) if v.id == AEVANN_ID and SITE_NAME == 'rDrama': - listing = listing.filter(cls.kind.in_(('ban_user','unban_user','shadowban','unshadowban'))) + listing = listing.filter(cls.kind.in_(AEVANN_MODACTION_TYPES)) if v.admin_level < PERMS['PROGSTACK']: listing = listing.filter(cls.kind.notin_(MODACTION_PRIVILEGED__TYPES))