master
Aevann1 2021-09-16 19:36:14 +02:00
parent 329e5939a7
commit 97b51b81cd
1 changed files with 5 additions and 0 deletions

View File

@ -32,14 +32,19 @@ def notifications(v):
notifications = v.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ACCOUNT).order_by(Notification.id.desc()).offset(25 * (page - 1)).limit(26).all()
comments = []
notifs = []
for index, x in enumerate(notifications):
c = x.comment
if x.read and index > 26: break
elif not x.read:
c.unread = True
notifs.append({'id': x.id, 'read': True})
x.read = True
g.db.add(x)
comments.append(c)
session.bulk_update_mappings(User, notifs)
next_exists = (len(comments) > 25)
listing = comments[:25]
else: