From 17d6fc3dc6fabdfdd775ac5a59ad30f569833608 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 6 Mar 2022 00:19:07 +0200 Subject: [PATCH] bruh --- files/helpers/alerts.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index 2905a840ad..211563b8f4 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -46,7 +46,12 @@ def notif_comment(text, autojanny=False): text_html = sanitize(text, alert=True) - existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none() + 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() + 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() if existing: return existing[0] else: return create_comment(text_html, autojanny)