forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-09-16 19:41:48 +02:00
parent da2e085a32
commit 9a6fc86369
1 changed files with 7 additions and 4 deletions

View File

@ -43,6 +43,8 @@ def notifications(v):
comments.append(c)
g.db.bulk_update_mappings(Notification, notifs)
g.db.commit()
next_exists = (len(comments) > 25)
listing = comments[:25]
else:
@ -58,15 +60,18 @@ def notifications(v):
cids = [x.comment_id for x in notifications]
comments = get_comments(cids, v=v, load_parent=True)
notifs = []
i = 0
for x in notifications:
try:
if not x.read: comments[i].unread = True
except: continue
x.read = True
g.db.add(x)
notifs.append({'id': x.id, 'read': True})
i += 1
g.db.bulk_update_mappings(Notification, notifs)
g.db.commit()
if not posts:
listing = []
for c in comments:
@ -96,8 +101,6 @@ def notifications(v):
listing.append(c)
g.db.commit()
return render_template("notifications.html",
v=v,
notifications=listing,