From c738245783e07533a76d769d38ec7ea6cbf4a1c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Mon, 2 Sep 2024 23:52:28 +0200 Subject: [PATCH] Properly display non-game type names --- games/views/purchase.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/games/views/purchase.py b/games/views/purchase.py index e75d338..87b4f77 100644 --- a/games/views/purchase.py +++ b/games/views/purchase.py @@ -44,6 +44,7 @@ def list_purchases(request: HttpRequest) -> HttpResponse: "data": { "columns": [ "Name", + "Type", "Platform", "Price", "Currency", @@ -67,8 +68,13 @@ def list_purchases(request: HttpRequest) -> HttpResponse: ), ), ], - truncate_with_popover(purchase.edition.game.name), + truncate_with_popover( + purchase.edition.game.name + if purchase.type == "game" + else f"{purchase.edition.game.name} ({purchase.name})" + ), ), + purchase.get_type_display(), purchase.platform, purchase.price, purchase.price_currency,