Fix ordering

This commit is contained in:
Lukáš Kucharczyk 2023-11-09 21:43:17 +01:00
parent cbf872d21f
commit 87f50cedd2
1 changed files with 9 additions and 3 deletions

View File

@ -380,9 +380,15 @@ def stats(request, year: int = 0):
"spent_per_game": int( "spent_per_game": int(
safe_division(total_spent, this_year_purchases_without_refunded.count()) safe_division(total_spent, this_year_purchases_without_refunded.count())
), ),
"all_finished_this_year": purchases_finished_this_year, "all_finished_this_year": purchases_finished_this_year.order_by(
"this_year_finished_this_year": purchases_finished_this_year_released_this_year, "date_finished"
"purchased_this_year_finished_this_year": purchased_this_year_finished_this_year, ),
"this_year_finished_this_year": purchases_finished_this_year_released_this_year.order_by(
"date_finished"
),
"purchased_this_year_finished_this_year": purchased_this_year_finished_this_year.order_by(
"date_finished"
),
"total_sessions": this_year_sessions.count(), "total_sessions": this_year_sessions.count(),
"unique_days": unique_days["dates"], "unique_days": unique_days["dates"],
"unique_days_percent": int(unique_days["dates"] / 365 * 100), "unique_days_percent": int(unique_days["dates"] / 365 * 100),