fix(clock): colliding points annotation with CustomUser.points field
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user