order /banned and /admin/shadowbanned by ban reason

master
Aevann 2023-01-21 07:50:48 +02:00
parent 2b3dd62a86
commit e3fc980984
2 changed files with 2 additions and 4 deletions

View File

@ -390,7 +390,7 @@ def shadowbanned(v):
.filter( .filter(
User.shadowbanned != None, User.shadowbanned != None,
) \ ) \
.order_by(User.truescore.desc()).all() .order_by(User.ban_reason).all()
return render_template("admin/shadowbanned.html", v=v, users=users) return render_template("admin/shadowbanned.html", v=v, users=users)

View File

@ -185,9 +185,7 @@ def banned(v:User):
users = g.db.query(User).filter( users = g.db.query(User).filter(
User.is_banned != None, User.is_banned != None,
or_(User.unban_utc == 0, User.unban_utc > time.time()), or_(User.unban_utc == 0, User.unban_utc > time.time()),
) ).order_by(User.ban_reason)
if v.admin_level >= PERMS['VIEW_LAST_ACTIVE']:
users = users.order_by(User.truescore.desc())
if not v.can_see_shadowbanned: if not v.can_see_shadowbanned:
users = users.filter(User.shadowbanned == None) users = users.filter(User.shadowbanned == None)
users = users.all() users = users.all()