Skip to content

Commit

Permalink
sort properly
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Jan 16, 2024
1 parent d96a33c commit f1f994f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dojo_plugin/utils/belts.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ def get_belts():
for user_id in result["users"]:
result["ranks"][result["users"][user_id]["color"]].append(user_id)

for rank in result["ranks"].values():
rank.sort(key=lambda uid: result["users"][uid]["date"])

return result
2 changes: 1 addition & 1 deletion dojo_theme/templates/belts.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h2>{{belt_color.title()}} Belts</h2>
</p>

<ul style="list-style-image: url({{ url_for("views.themes", path="img/dojo/" + belt_color + ".svg") }})">
{% for user_id in belt_data.ranks[belt_color]|sort(attribute='date') %}
{% for user_id in belt_data.ranks[belt_color] %}
{% set user = belt_data.users[user_id] %}
<li>
<a href="{{ url_for("pwncollege_users.view_other", user_id=user_id) }}"><raw>{{ user.handle }}</raw></a>
Expand Down

0 comments on commit f1f994f

Please sign in to comment.