mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
fix: get users
This commit is contained in:
+2
-3
@@ -316,7 +316,7 @@ def get_all_users(query: GetAllUsersQuery):
|
||||
"users": [],
|
||||
}
|
||||
|
||||
users = UserTable.get_all()
|
||||
users = [u for u in UserTable.get_all()]
|
||||
is_admin = current_user and "admin" in current_user["roles"]
|
||||
settings["enableGuest"] = [
|
||||
user for user in users if user.username == "guest"
|
||||
@@ -348,8 +348,7 @@ def get_all_users(query: GetAllUsersQuery):
|
||||
users = [user for user in users if user.username == "guest"]
|
||||
|
||||
# reverse list to show latest users first
|
||||
users = list(reversed(users))
|
||||
|
||||
users = reversed(users)
|
||||
# bring admins to the front
|
||||
users = sorted(users, key=lambda x: "admin" in x.roles, reverse=True)
|
||||
# bring current user to index 0
|
||||
|
||||
Reference in New Issue
Block a user