forked from rDrama/rDrama
parent
05a56ac429
commit
3e7e2769c4
|
@ -785,11 +785,11 @@ class User(Base):
|
||||||
def modmail_notifications_count(self):
|
def modmail_notifications_count(self):
|
||||||
if self.admin_level < PERMS['NOTIFICATIONS_MODMAIL']:
|
if self.admin_level < PERMS['NOTIFICATIONS_MODMAIL']:
|
||||||
return 0
|
return 0
|
||||||
return g.db.query(Comment.top_comment_id).filter(
|
return g.db.query(Comment).distinct(Comment.top_comment_id).filter(
|
||||||
Comment.author_id != self.id,
|
Comment.author_id != self.id,
|
||||||
Comment.sentto == MODMAIL_ID,
|
Comment.sentto == MODMAIL_ID,
|
||||||
Comment.created_utc > self.last_viewed_modmail_notifs,
|
Comment.created_utc > self.last_viewed_modmail_notifs,
|
||||||
).group_by(Comment.top_comment_id).count()
|
).count()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
|
|
Loading…
Reference in New Issue