Skip to content

Commit

Permalink
Merge pull request #464 from scidsg/directory-order
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-sorrentino committed Jul 29, 2024
2 parents 9daf13f + 98a843d commit 47a8ef4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions hushline/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,8 @@ def sort_users_by_display_name(users: list[User], admin_first: bool = True) -> l
return sorted(users, key=lambda u: (u.display_name or u.primary_username).strip().lower())

def get_directory_users() -> list[User]:
return (
User.query.filter_by(show_in_directory=True)
.order_by(User.is_admin.desc(), User.display_name.asc())
.all()
)
users = User.query.filter_by(show_in_directory=True).all()
return sort_users_by_display_name(users)

@app.route("/directory")
def directory() -> Response | str:
Expand Down

0 comments on commit 47a8ef4

Please sign in to comment.