From e3fc9809848a1436b9769b2230f0d5724ba8973a Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 21 Jan 2023 07:50:48 +0200 Subject: [PATCH] order /banned and /admin/shadowbanned by ban reason --- files/routes/admin.py | 2 +- files/routes/users.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 827ce3394..98945e9d7 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -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) diff --git a/files/routes/users.py b/files/routes/users.py index 35f848d2a..5ac840600 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -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()