forked from rDrama/rDrama
1
0
Fork 0

exclude shadowbanned from random_user

master
Aevann 2023-10-13 00:13:49 +03:00
parent 1c3da1be6b
commit 9f4eac494d
1 changed files with 4 additions and 1 deletions

View File

@ -195,7 +195,10 @@ def random_post(v):
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
@auth_required
def random_user(v):
u = g.db.query(User.username).filter(User.song != None).order_by(func.random()).first()
u = g.db.query(User.username).filter(
User.song != None,
User.shadowbanned == None,
).order_by(func.random()).first()
if u: u = u[0]
else: abort(404, "No users have set a profile anthem so far!")