From 0ff74da5b0ae504f54cb871225fc5ca19386d008 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 24 Nov 2021 00:44:16 +0200 Subject: [PATCH] sfdfds --- files/helpers/alerts.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index 97a2e1519..e57c2ed79 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -14,7 +14,10 @@ def send_notification(uid, text, autojanny=False): text_html = sanitize(text_html) if autojanny: author_id = AUTOJANNY_ID - else: author_id = NOTIFICATIONS_ID + else: + author_id = NOTIFICATIONS_ID + existing = g.db.query(Comment.id).filter(Comment.author_id == author_id, Comment.body_html == text_html, Comment.notifiedto == uid).first() + if existing: return new_comment = Comment(author_id=author_id, parent_submission=None,