fd
This commit is contained in:
parent
4fcae27273
commit
9b7ce8f599
1 changed files with 3 additions and 5 deletions
|
@ -51,16 +51,14 @@ def notifications(v):
|
||||||
Comment.author_id != AUTOJANNY_ACCOUNT,
|
Comment.author_id != AUTOJANNY_ACCOUNT,
|
||||||
).order_by(Notification.id.desc()).offset(25 * (page - 1)).limit(26)
|
).order_by(Notification.id.desc()).offset(25 * (page - 1)).limit(26)
|
||||||
|
|
||||||
|
next_exists = (len(notifications) == 26)
|
||||||
|
notifications = notifications[:25]
|
||||||
cids = [x.comment_id for x in notifications]
|
cids = [x.comment_id for x in notifications]
|
||||||
next_exists = (len(cids) == 26)
|
|
||||||
cids = cids[:25]
|
|
||||||
comments = get_comments(cids, v=v, load_parent=True)
|
comments = get_comments(cids, v=v, load_parent=True)
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
for x in notifications:
|
for x in notifications:
|
||||||
if not x.read:
|
if not x.read: comments[i].unread = True
|
||||||
try: comments[i].unread = True
|
|
||||||
except: pass
|
|
||||||
x.read = True
|
x.read = True
|
||||||
g.db.add(x)
|
g.db.add(x)
|
||||||
i += 1
|
i += 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue