fd
This commit is contained in:
parent
4fb2283352
commit
556a3b8c7d
1 changed files with 7 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue