remotes/1693045480750635534/spooky-22
Aevann1 2021-07-25 04:53:09 +02:00
parent e86ac0b757
commit b6dbb02496
2 changed files with 4 additions and 5 deletions

View File

@ -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)

View File

@ -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]