changed query, disabled click sort and grammar

pull/115/head
mummified-corroding-granny 2023-02-08 01:43:17 +00:00
parent 90093b504a
commit 655ed70e4d
2 changed files with 3 additions and 2 deletions

View File

@ -182,10 +182,11 @@ def user_voted_comments(v:User, username):
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)
@auth_required
def banned(v:User):
# group temporary bans first and permanent bans last
users = g.db.query(User).filter(
User.is_banned != None,
or_(User.unban_utc == 0, User.unban_utc > time.time()),
).order_by(User.ban_reason)
).order_by(case((User.unban_utc > 0, 1), else_=2)).order_by(User.unban_utc)
if not v.can_see_shadowbanned:
users = users.filter(User.shadowbanned == None)
users = users.all()

View File

@ -14,7 +14,7 @@
<th>Truescore</th>
<th>Ban reason</th>
<th>Banned by</th>
<th>Unban in</th>
<th class="disable-click-sort">Unban on</th>
</tr>
</thead>
{% for user in users %}