From f9e37e9b1e5b9dd351b40ca35c3980db7f0ac7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Sun, 18 Feb 2024 09:02:08 +0100 Subject: [PATCH] Sort purchases also by date purchased --- CHANGELOG.md | 1 + games/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e71707e..b7978c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ## Improved * mark refunded purchases red on game overview * increase session count on game overview when starting a new session +* game overview: sort purchases also by date purchased (on top of date released) ## Fixed * Fix title not being displayed on the Recent sessions page diff --git a/games/views.py b/games/views.py index 80bdd2a..15e09c8 100644 --- a/games/views.py +++ b/games/views.py @@ -164,7 +164,7 @@ def view_game(request, game_id=None): editions = ( Edition.objects.filter(game=game) .prefetch_related(game_purchases_prefetch) - .order_by("year_released") + .order_by("year_released", "purchase__date_purchased") ) sessions = Session.objects.prefetch_related("device").filter(