forked from rDrama/rDrama
master
parent
424adaa673
commit
76400edc24
|
@ -33,19 +33,19 @@ def notifications(v):
|
||||||
cids = cids[:100]
|
cids = cids[:100]
|
||||||
comments = get_comments(cids, v=v)
|
comments = get_comments(cids, v=v)
|
||||||
elif posts:
|
elif posts:
|
||||||
notifications = v.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ACCOUNT).order_by(Notification.id.desc()).offset(100 * (page - 1)).all()
|
notifications = v.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ACCOUNT).order_by(Notification.id.desc()).offset(25 * (page - 1)).all()
|
||||||
|
|
||||||
comments = []
|
comments = []
|
||||||
for index, x in enumerate(notifications):
|
for index, x in enumerate(notifications):
|
||||||
c = x.comment
|
c = x.comment
|
||||||
if x.read and index > 101: break
|
if x.read and index > 26: break
|
||||||
elif not x.read:
|
elif not x.read:
|
||||||
c.unread = True
|
c.unread = True
|
||||||
x.read = True
|
x.read = True
|
||||||
g.db.add(x)
|
g.db.add(x)
|
||||||
comments.append(c)
|
comments.append(c)
|
||||||
next_exists = (len(comments) > 100)
|
next_exists = (len(comments) > 25)
|
||||||
listing = comments[:100]
|
listing = comments[:25]
|
||||||
else:
|
else:
|
||||||
|
|
||||||
notifications = v.notifications.join(Notification.comment).filter(
|
notifications = v.notifications.join(Notification.comment).filter(
|
||||||
|
|
Loading…
Reference in New Issue