bans: don't leak shadowbans to people who can't see them

master
justcool393 2022-11-01 15:59:18 -05:00
parent 651cd60aa2
commit 89d5428f77
1 changed files with 4 additions and 1 deletions

View File

@ -348,7 +348,10 @@ def blocks(v):
@app.get("/banned")
@auth_required
def banned(v):
users = g.db.query(User).filter(User.is_banned > 0, User.unban_utc == 0).all()
users = g.db.query(User).filter(User.is_banned > 0, User.unban_utc == 0)
if not v.can_see_shadowbanned:
users = users.filter(User.shadowbanned == None)
users = users.all()
return render_template("banned.html", v=v, users=users)
@app.get("/formatting")