diff --git a/drama/classes/user.py b/drama/classes/user.py index 5258849715..b0210f71a9 100644 --- a/drama/classes/user.py +++ b/drama/classes/user.py @@ -194,11 +194,6 @@ class User(Base, Stndrd, Age_times): or_(and_(UserBlock.user_id == self.id, UserBlock.target_id == other.id), and_( UserBlock.user_id == other.id, UserBlock.target_id == self.id))).first() - def has_blocked_guild(self, board): - - return g.db.query(BoardBlock).filter_by( - user_id=self.id, board_id=board.id).first() - def validate_2fa(self, token): x = pyotp.TOTP(self.mfa_secret) diff --git a/drama/helpers/get.py b/drama/helpers/get.py index 602b8309be..11f1c74aa1 100644 --- a/drama/helpers/get.py +++ b/drama/helpers/get.py @@ -161,6 +161,10 @@ def get_posts(pids, v=None): blocking, blocking.c.target_id == Submission.author_id, isouter=True + ).join( + blocked, + blocked.c.user_id == Submission.author_id, + isouter=True ).all() output = [p[0] for p in query]