diff --git a/files/routes/front.py b/files/routes/front.py index 484b933d6..091242500 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -92,50 +92,35 @@ def notifications(v): g.db.commit() next_exists = (len(notifications) > len(listing)) - else: - comments = g.db.query(Notification, Comment).join(Comment, Notification.comment_id == Comment.id).filter( - Notification.user_id == v.id, - Comment.author_id != AUTOJANNY_ID, - Comment.body_html.notlike('%

New site mention: 2)): + comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None) + + comments = comments.offset(25 * (page - 1)).limit(26).all() - if v and (v.shadowbanned or v.admin_level > 2): - comments = g.db.query(Comment).join(sq, sq.c.id == Comment.id).order_by(sq.c.created_utc.desc()).offset(25 * (page - 1)).limit(26).all() - else: - comments = g.db.query(Comment).join(sq, sq.c.id == Comment.id).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None).order_by(sq.c.created_utc.desc()).offset(25 * (page - 1)).limit(26).all() - next_exists = (len(comments) > 25) comments = comments[:25] - cids = [x[0] for x in g.db.query(Comment.id).join(Notification, Notification.comment_id == Comment.id).filter( - Notification.user_id == v.id, - Comment.is_banned == False, - Comment.deleted_utc == 0, - Comment.author_id != AUTOJANNY_ID, - Comment.body_html.notlike('%

New site mention: