switch to AEVANN_EXCLUDED_MODACTION_TYPES

pull/226/head
Aevann 2024-03-31 00:06:32 +02:00
parent d4db5b3ebe
commit 2e12586bc0
3 changed files with 4 additions and 6 deletions

View File

@ -902,7 +902,7 @@ class User(Base):
ModAction.user_id != self.id,
)
if self.id == AEVANN_ID:
q = q.filter(ModAction.kind.in_(AEVANN_MODACTION_TYPES))
q = q.filter(ModAction.kind.notin_(AEVANN_EXCLUDED_MODACTION_TYPES))
if self.admin_level < PERMS['PROGSTACK']:
q = q.filter(ModAction.kind.notin_(MODACTION_PRIVILEGED__TYPES))

View File

@ -485,7 +485,5 @@ 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',
'delete_media','reset_password','unchud',
'mark_effortpost', 'unmark_effortpost'}
AEVANN_EXCLUDED_MODACTION_TYPES = {'pin_post', 'unpin_post'
'pin_comment', 'unpin_comment'}

View File

@ -257,7 +257,7 @@ def notifications_modactions(v):
listing = g.db.query(cls).filter(cls.user_id != v.id)
if v.id == AEVANN_ID:
listing = listing.filter(cls.kind.in_(AEVANN_MODACTION_TYPES))
listing = listing.filter(cls.kind.notin_(AEVANN_EXCLUDED_MODACTION_TYPES))
if v.admin_level < PERMS['PROGSTACK']:
listing = listing.filter(cls.kind.notin_(MODACTION_PRIVILEGED__TYPES))