From c341be28669425b1ef5b1d7a720a260123ba59b9 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 29 Jun 2022 05:07:00 +0200 Subject: [PATCH] show posts by users who block you --- files/classes/user.py | 2 +- files/routes/front.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index bb3342454..f1626aab5 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -701,7 +701,7 @@ class User(Base): @property @lazy def userblocks(self): - return [x[0] for x in g.db.query(UserBlock.target_id).filter_by(user_id=self.id).all()] + [x[0] for x in g.db.query(UserBlock.user_id).filter_by(target_id=self.id).all()] + return [x[0] for x in g.db.query(UserBlock.target_id).filter_by(user_id=self.id).all()] @lazy def saved_idlist(self, page=1): diff --git a/files/routes/front.py b/files/routes/front.py index afd868a0b..7ad66a7e5 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -368,8 +368,6 @@ def changeloglist(v=None, sort="new", page=1, t="all", site=None): posts = g.db.query(Submission.id).filter_by(is_banned=False, private=False, deleted_utc=0) - posts = posts.filter(Submission.author_id.notin_(v.userblocks)) - allowed = g.db.query(User.id).filter(User.admin_level > 0).all() + g.db.query(Badge.user_id).filter_by(badge_id=3).all() allowed = [x[0] for x in allowed]