From 4517ff2b5a5359c6647d5d30d2f2b8819b7944ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Thu, 9 Nov 2023 21:43:17 +0100 Subject: [PATCH] Fix ordering --- games/views.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/games/views.py b/games/views.py index e4f3f93..25b13ee 100644 --- a/games/views.py +++ b/games/views.py @@ -380,9 +380,15 @@ def stats(request, year: int = 0): "spent_per_game": int( safe_division(total_spent, this_year_purchases_without_refunded.count()) ), - "all_finished_this_year": purchases_finished_this_year, - "this_year_finished_this_year": purchases_finished_this_year_released_this_year, - "purchased_this_year_finished_this_year": purchased_this_year_finished_this_year, + "all_finished_this_year": purchases_finished_this_year.order_by( + "date_finished" + ), + "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(), "unique_days": unique_days["dates"], "unique_days_percent": int(unique_days["dates"] / 365 * 100),