From ef6ead1f828cea5a9988375238b7397453c4b4e2 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 5 Sep 2023 15:04:24 +0300 Subject: [PATCH] handle edge case when a new user tried to DM a janny and gets undersieged, resulting in duplicate notifications --- files/routes/users.py | 1 + 1 file changed, 1 insertion(+) diff --git a/files/routes/users.py b/files/routes/users.py index e372120b27..e60b593230 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -651,6 +651,7 @@ def message2(v, username=None, id=None): c.top_comment_id = c.id if user.id not in BOT_IDs: + g.db.flush() notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user.id).one_or_none() if not notif: notif = Notification(comment_id=c.id, user_id=user.id)