fix(clock): colliding points annotation with CustomUser.points field

This commit is contained in:
2026-10-16 02:30:06 +02:00
parent 377bc91bcb
commit 54ffe89445
2 changed files with 9 additions and 8 deletions
+5 -5
View File
@@ -54,8 +54,8 @@ def current_state(request: HttpRequest, event_path: str):
def my_stats(request: HttpRequest, event_path: str):
ranked = list(
ranked_players(request.event)
.values("id", "points", "rank")
.order_by("-points", "id")
.values("id", "clock_points", "rank")
.order_by("-clock_points", "id")
)
total_players = len(ranked)
my_index = next(
@@ -71,9 +71,9 @@ def my_stats(request: HttpRequest, event_path: str):
)
return {
"points": mine["points"] if mine else 0.0,
"points": mine["clock_points"] if mine else 0.0,
"rank": mine["rank"] if mine else total_players,
"total_players": total_players,
"points_above": above["points"] if above else None,
"points_below": below["points"] if below else None,
"points_above": above["clock_points"] if above else None,
"points_below": below["clock_points"] if below else None,
}