From 3e7e2769c49c0ba26b75237aab156309c5c646b2 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 1 Feb 2024 22:34:03 +0200 Subject: [PATCH] Revert "try fixing ghost modmail notifs" This reverts commit 05a56ac4293266eef706a5d51ad7268650efb52a. --- files/classes/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 2fea4e1cc..963cd58fc 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -785,11 +785,11 @@ class User(Base): def modmail_notifications_count(self): if self.admin_level < PERMS['NOTIFICATIONS_MODMAIL']: 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.sentto == MODMAIL_ID, Comment.created_utc > self.last_viewed_modmail_notifs, - ).group_by(Comment.top_comment_id).count() + ).count() @property @lazy