forked from rDrama/rDrama
give me notifs for only "ban_user" and "shadowban"
parent
da4c15d0af
commit
ecfba3e3b5
|
@ -644,13 +644,16 @@ class User(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def modaction_notifications_count(self):
|
def modaction_notifications_count(self):
|
||||||
if self.id == AEVANN_ID: return 0
|
if self.id == AEVANN_ID and SITE_NAME != 'rDrama': return 0
|
||||||
|
|
||||||
if self.admin_level:
|
if self.admin_level:
|
||||||
return g.db.query(ModAction).filter(
|
q = g.db.query(ModAction).filter(
|
||||||
ModAction.created_utc > self.last_viewed_log_notifs,
|
ModAction.created_utc > self.last_viewed_log_notifs,
|
||||||
ModAction.user_id != self.id,
|
ModAction.user_id != self.id,
|
||||||
).count()
|
)
|
||||||
|
if self.id == AEVANN_ID:
|
||||||
|
q = q.filter(ModAction.kind.in_(('ban_user','shadowban')))
|
||||||
|
return q.count()
|
||||||
|
|
||||||
if self.moderated_subs:
|
if self.moderated_subs:
|
||||||
return g.db.query(SubAction).filter(
|
return g.db.query(SubAction).filter(
|
||||||
|
|
|
@ -192,6 +192,9 @@ 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':
|
||||||
|
listing.filter(cls.kind.in_(('ban_user','shadowban')))
|
||||||
|
|
||||||
if cls == SubAction:
|
if cls == SubAction:
|
||||||
listing = listing.filter(cls.sub.in_(v.moderated_subs))
|
listing = listing.filter(cls.sub.in_(v.moderated_subs))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue