This commit is contained in:
fireworks88 2021-09-06 23:04:01 +02:00
parent 6551cb8c93
commit 20d9319014
2 changed files with 9 additions and 3 deletions

View file

@ -9,6 +9,12 @@ from .const import *
def send_notification(vid, user, text, db=None):
# for when working outside request context
if isinstance(user, int):
uid = user
else:
uid = user.id
if not db:
db = g.db
@ -34,7 +40,7 @@ def send_notification(vid, user, text, db=None):
db.add(new_aux)
notif = Notification(comment_id=new_comment.id,
user_id=user.id)
user_id=uid)
db.add(notif)