Fix: Toggling comment removal breaks stuff.
This commit is contained in:
parent
2f0a3fc278
commit
37b140bcc2
1 changed files with 5 additions and 2 deletions
|
@ -200,6 +200,9 @@ def comment_on_publish(comment:Comment):
|
||||||
to_notify.add(parent.author_id)
|
to_notify.add(parent.author_id)
|
||||||
|
|
||||||
for uid in to_notify:
|
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)
|
notif = Notification(comment_id=comment.id, user_id=uid)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue