Fix: Toggling comment removal breaks stuff.

This commit is contained in:
Ben Rog-Wilhelm 2023-06-25 03:45:40 -05:00
parent 2f0a3fc278
commit 31ebdd0213

View file

@ -200,6 +200,9 @@ def comment_on_publish(comment:Comment):
to_notify.add(parent.author_id)
for uid in to_notify:
notif = g.db.query(Notification) \
.filter_by(comment_id=comment.id, user_id=uid).one_or_none()
if not notif:
notif = Notification(comment_id=comment.id, user_id=uid)
g.db.add(notif)