From 49dff5a7cbdd59eb8fdab34414ad72c3679f4865 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 21 Feb 2022 05:07:36 +0200 Subject: [PATCH] cvb --- files/routes/front.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index bc295e184e..b805f2af4f 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -42,8 +42,9 @@ 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()).all() - next_exists = False + 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] 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)