From e290995d6dce8b215afe27a3d6cef8219d09c0a7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 6 Mar 2022 21:22:33 +0200 Subject: [PATCH] ki --- files/helpers/alerts.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index 211563b8f4..897cc3897c 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -49,6 +49,13 @@ def notif_comment(text, autojanny=False): try: existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none() except: existing = g.db.query(Comment).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).all() + + + notifs = g.db.query(Notification).filter(Notification.comment_id.in_([x.id for x in existing])).all() + for c in notifs: g.db.delete(c) + g.db.flush() + + for c in existing: g.db.delete(c) g.db.flush() existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none()