zgdzu
This commit is contained in:
parent
6551cb8c93
commit
20d9319014
2 changed files with 9 additions and 3 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue