Skip to content

Commit

Permalink
Better sort
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinorg committed Jan 3, 2025
1 parent 79e7d77 commit 114e222
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion freezing/web/views/people.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def ridedays():
daily_scores b where a.id = b.athlete_id
group by b.athlete_id
order by
case when rides = :total then 0 when rides = :total - 1 and contender = 0 then 1 else 2 end,
rides desc,
display_name
;
Expand All @@ -146,7 +147,9 @@ def ridedays():
all_done = competition_done(loc_time)
ride_days = [
(x["id"], x["display_name"], x["rides"], x["miles"], x["contender"])
for x in meta.engine.execute(q, today=loc_time.date()).fetchall()
for x in meta.engine.execute(
q, today=loc_time.date(), total=loc_total_days
).fetchall()
]
return render_template(
"people/ridedays.html",
Expand Down

0 comments on commit 114e222

Please sign in to comment.