diff --git a/CHANGELOG.md b/CHANGELOG.md index a1335ef..760e1b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ * Season Pass * Battle Pass +## Fixed +* Order purchases by date on game view + ## 1.4.0 / 2023-11-09 21:01+01:00 ### New diff --git a/games/views.py b/games/views.py index b2bab74..c859d5f 100644 --- a/games/views.py +++ b/games/views.py @@ -141,8 +141,10 @@ def view_game(request, game_id=None): context["title"] = "View Game" context["game"] = game context["editions"] = Edition.objects.filter(game_id=game_id) - game_purchases = Purchase.objects.filter(edition__game_id=game_id).filter( - type=Purchase.GAME + game_purchases = ( + Purchase.objects.filter(edition__game_id=game_id) + .filter(type=Purchase.GAME) + .order_by("date_purchased") ) for purchase in game_purchases: purchase.related_purchases = Purchase.objects.exclude(