constantify my log action types
parent
303db4e6db
commit
ffa04a3cd5
|
@ -651,7 +651,7 @@ class User(Base):
|
||||||
ModAction.user_id != self.id,
|
ModAction.user_id != self.id,
|
||||||
)
|
)
|
||||||
if self.id == AEVANN_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']:
|
if self.admin_level < PERMS['PROGSTACK']:
|
||||||
q = q.filter(ModAction.kind.notin_(MODACTION_PRIVILEGED__TYPES))
|
q = q.filter(ModAction.kind.notin_(MODACTION_PRIVILEGED__TYPES))
|
||||||
|
|
|
@ -372,3 +372,6 @@ MODACTION_TYPES_FILTERED = deepcopy({t:v for t,v in MODACTION_TYPES.items()
|
||||||
if not t in MODACTION_PRIVILEGED_TYPES})
|
if not t in MODACTION_PRIVILEGED_TYPES})
|
||||||
MODACTION_TYPES__FILTERED = deepcopy({t:v for t,v in MODACTION_TYPES.items()
|
MODACTION_TYPES__FILTERED = deepcopy({t:v for t,v in MODACTION_TYPES.items()
|
||||||
if not t in MODACTION_PRIVILEGED__TYPES})
|
if not t in MODACTION_PRIVILEGED__TYPES})
|
||||||
|
AEVANN_MODACTION_TYPES = {'ban_user','unban_user',
|
||||||
|
'shadowban','unshadowban',
|
||||||
|
'progstack_post','progstack_comment'}
|
||||||
|
|
|
@ -198,7 +198,7 @@ def notifications_modactions(v:User):
|
||||||
listing = g.db.query(cls).filter(cls.user_id != v.id)
|
listing = g.db.query(cls).filter(cls.user_id != v.id)
|
||||||
|
|
||||||
if v.id == AEVANN_ID and SITE_NAME == 'rDrama':
|
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']:
|
if v.admin_level < PERMS['PROGSTACK']:
|
||||||
listing = listing.filter(cls.kind.notin_(MODACTION_PRIVILEGED__TYPES))
|
listing = listing.filter(cls.kind.notin_(MODACTION_PRIVILEGED__TYPES))
|
||||||
|
|
Loading…
Reference in New Issue