From c139f88563e04334a570de80dc42bf665409e090 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 31 Aug 2021 18:08:29 +0200 Subject: [PATCH] dffd --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 4bb857f705..93d2583ea2 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -24,8 +24,8 @@ def notifications(v): messages = request.args.get('messages', False) posts = request.args.get('posts', False) if messages: - if v.admin_level == 6: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id, Comment.sentto==0)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(200).all() - else: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(200).all() + if v.admin_level == 6: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id, Comment.sentto==0)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(50).all() + else: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(50).all() comments = [c for c in comments if c.child_comments == []][:26] next_exists = (len(comments) == 26) comments = comments[:25]