diff --git a/files/routes/notifications.py b/files/routes/notifications.py index 9ba40ccf4..706fa42ac 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -142,7 +142,7 @@ def notifications_messages(v): def notifications_chats(v): criteria1 = (Chat.id == ChatMembership.chat_id, ChatMembership.user_id == v.id) criteria2 = (Chat.id == ChatNotification.chat_id, ChatNotification.user_id == v.id) - chats = g.db.query(Chat, func.count(ChatNotification.chat_id)).join(ChatMembership, and_(*criteria1)).outerjoin(ChatNotification, and_(*criteria2)).group_by(Chat).order_by(func.count(ChatNotification.chat_id).desc(), ChatMembership.created_utc.desc()).all() + chats = g.db.query(Chat, func.count(ChatNotification.chat_id)).join(ChatMembership, and_(*criteria1)).outerjoin(ChatNotification, and_(*criteria2)).group_by(Chat, ChatMembership.created_utc).order_by(func.count(ChatNotification.chat_id).desc(), ChatMembership.created_utc.desc()).all() return render_template("notifications.html", v=v, notifications=chats) @app.get("/notifications/modmail")