remotes/1693045480750635534/spooky-22
fireworks88 2021-09-06 23:04:01 +02:00
parent b56720b87d
commit 7a4fd470e8
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)

View File

@ -887,7 +887,7 @@ def submit_post(v):
post_url = upload_video(file)
new_post.url = post_url
new_post.processing = True
gevent.spawn(check_processing_thread, v, new_post, post_url, g.db)
gevent.spawn(check_processing_thread, v.id, new_post, post_url, g.db)
except UploadException as e:
if request.headers.get("Authorization"):
return {
@ -909,7 +909,7 @@ def submit_post(v):
post_url = upload_video(file)
new_post.url = post_url
new_post.processing = True
gevent.spawn(check_processing_thread, v, new_post, post_url, g.db)
gevent.spawn(check_processing_thread, v.id, new_post, post_url, g.db)
except UploadException as e:
if request.headers.get("Authorization"):
return {