This commit is contained in:
Aevann1 2021-12-17 20:04:42 +02:00
parent ba8931cb7f
commit 2d8f871d51
2 changed files with 16 additions and 5 deletions

View file

@ -13,11 +13,13 @@ def send_notification(uid, text, autojanny=False):
text_html = CustomRenderer().render(mistletoe.Document(text))
text_html = sanitize(text_html)
if autojanny: author_id = AUTOJANNY_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
author_id = AUTOJANNY_ID
# if autojanny: author_id = AUTOJANNY_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,