From 82d794249b8deb625f5b15067411978bee8017a8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 10 Oct 2021 06:19:13 +0200 Subject: [PATCH] dfsfsd --- files/classes/user.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 7828258ba..dd306e63d 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -537,10 +537,8 @@ class User(Base): def saved_comment_idlist(self, page=1): - comments = g.db.query(Comment.id).options(lazyload('*')).filter_by(is_banned=False, deleted_utc=0) - saved = [x[0] for x in g.db.query(SaveRelationship.submission_id).options(lazyload('*')).filter(SaveRelationship.user_id == self.id).all()] - comments = comments.filter(Comment.id.in_(saved)) + comments = g.db.query(Comment.id).options(lazyload('*')).filter(Comment.id.in_(saved)) if self.admin_level == 0: blocking = [x[0] for x in g.db.query( @@ -555,9 +553,7 @@ class User(Base): Comment.author_id.notin_(blocked) ) - comments = comments.order_by(Comment.created_utc.desc()) - - ids = [x[0] for x in comments.offset(25 * (page - 1)).limit(26).all()] + ids = [x[0] for x in comments.order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()] print(ids)