fix 500 error

pull/146/head
Aevann 2023-05-05 02:05:56 +03:00
parent b80e42f156
commit 8c0c1fe2e8
1 changed files with 4 additions and 1 deletions

View File

@ -299,7 +299,10 @@ def notifications(v:User):
Comment.is_banned != False,
Comment.deleted_utc != 0,
)
).update({Notification.read: True})
).options(defer('*')).all()
for n in unread_and_inaccessible:
n.read = True
g.db.add(n)
comments = g.db.query(Comment, Notification).options(load_only(Comment.id)).join(Notification.comment).filter(
Notification.user_id == v.id,