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

View File

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