From 78a3b0aeaf4e85e2ee8ab1a24c0eeca8e462d802 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 18 Apr 2024 18:24:19 +0200 Subject: [PATCH] switch the order of message and chat notifs --- files/classes/user.py | 16 ++++++++-------- files/templates/notifications.html | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index d964ccd44..92b1eb439 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -823,18 +823,13 @@ class User(Base): @lazy def normal_notifications_count(self): return self.notifications_count \ - - self.chats_notifications_count \ - self.message_notifications_count \ + - self.chats_notifications_count \ - self.modmail_notifications_count \ - self.post_notifications_count \ - self.modaction_notifications_count \ - self.offsite_notifications_count - @property - @lazy - def chats_notifications_count(self): - return g.db.query(ChatMembership).filter_by(user_id=self.id, notification=True).count() - @property @lazy def message_notifications_count(self): @@ -851,6 +846,11 @@ class User(Base): return notifs.count() + @property + @lazy + def chats_notifications_count(self): + return g.db.query(ChatMembership).filter_by(user_id=self.id, notification=True).count() + @property @lazy def modmail_notifications_count(self): @@ -937,10 +937,10 @@ class User(Base): # only meaningful when notifications_count > 0; otherwise falsely '' ~ normal if self.normal_notifications_count > 0: return '' - elif self.chats_notifications_count > 0: - return 'chats' elif self.message_notifications_count > 0: return 'messages' + elif self.chats_notifications_count > 0: + return 'chats' elif self.modmail_notifications_count > 0: return 'modmail' elif self.post_notifications_count > 0: diff --git a/files/templates/notifications.html b/files/templates/notifications.html index 92a3222bf..b1a52efd3 100644 --- a/files/templates/notifications.html +++ b/files/templates/notifications.html @@ -15,13 +15,13 @@ {% if v.admin_level >= PERMS['VIEW_MODMAIL'] %}