This commit is contained in:
Aevann1 2022-02-21 03:58:12 +02:00
parent 5d47158e5f
commit 661bc9f045
6 changed files with 57 additions and 26 deletions

View file

@ -42,9 +42,8 @@ def notifications(v):
modmail = request.values.get('modmail')
posts = request.values.get('posts')
if modmail and v.admin_level > 1:
comments = g.db.query(Comment).filter(Comment.sentto==2).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all()
next_exists = (len(comments) > 25)
comments = comments[:25]
comments = g.db.query(Comment).filter(Comment.sentto==2).order_by(Comment.id.desc()).all()
next_exists = False
elif messages:
comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, not_(Comment.child_comments.any())).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all()
next_exists = (len(comments) > 25)