From 9236b5bd039960e5c4d8a8d6d69c5abb7c1f77c9 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 10 Mar 2024 21:27:52 +0200 Subject: [PATCH] fix this https://rdrama.net/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/6088575#context --- files/routes/private_chats.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/routes/private_chats.py b/files/routes/private_chats.py index 9dd398d5c..f02bc8bfc 100644 --- a/files/routes/private_chats.py +++ b/files/routes/private_chats.py @@ -124,4 +124,8 @@ def leave_chat(v, chat_id): ) g.db.add(chat_leave) + chat_notifs = g.db.query(ChatNotification).filter_by(user_id=v.id, chat_id=chat_id) + for chat_notif in chat_notifs: + g.db.delete(chat_notif) + return {"message": "Chat left successfully!"}