forked from rDrama/rDrama
master
parent
88127d9a8b
commit
76c660c8f5
|
@ -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…
Reference in New Issue