fds
This commit is contained in:
parent
f0b1f76ff7
commit
a53ece934a
1 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,7 @@ def notifications(v):
|
||||||
modmail = request.values.get('modmail')
|
modmail = request.values.get('modmail')
|
||||||
posts = request.values.get('posts')
|
posts = request.values.get('posts')
|
||||||
if modmail and v.admin_level > 1:
|
if modmail and v.admin_level > 1:
|
||||||
comments = g.db.query(Comment).filter(Comment.sentto==0).order_by(Comment.created_utc.desc()).offset(25*(page-1)).limit(26).all()
|
comments = g.db.query(Comment).distinct(Comment.parent_comment_id).filter(Comment.sentto==0, not_(Comment.child_comments.any())).order_by(Comment.parent_comment_id.desc()).offset(25*(page-1)).limit(26).all()
|
||||||
next_exists = (len(comments) > 25)
|
next_exists = (len(comments) > 25)
|
||||||
comments = comments[:25]
|
comments = comments[:25]
|
||||||
elif messages:
|
elif messages:
|
||||||
|
@ -37,7 +37,7 @@ def notifications(v):
|
||||||
comments = g.db.query(Comment).distinct(Comment.parent_comment_id).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, Comment.sentto != None, not_(Comment.child_comments.any())).order_by(Comment.parent_comment_id.desc()).offset(25*(page-1)).limit(26).all()
|
comments = g.db.query(Comment).distinct(Comment.parent_comment_id).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, Comment.sentto != None, not_(Comment.child_comments.any())).order_by(Comment.parent_comment_id.desc()).offset(25*(page-1)).limit(26).all()
|
||||||
|
|
||||||
next_exists = (len(comments) > 25)
|
next_exists = (len(comments) > 25)
|
||||||
comments = comments[:25]
|
comments = comments[:24]
|
||||||
|
|
||||||
elif posts:
|
elif posts:
|
||||||
notifications = v.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ID).order_by(Notification.id.desc()).offset(25 * (page - 1)).limit(101).all()
|
notifications = v.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ID).order_by(Notification.id.desc()).offset(25 * (page - 1)).limit(101).all()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue