Properly display non-game type names
Django CI/CD / test (push) Successful in 1m8s Details
Django CI/CD / build-and-push (push) Successful in 1m55s Details

This commit is contained in:
Lukáš Kucharczyk 2024-09-02 23:52:28 +02:00
parent 57184ceea0
commit c738245783
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 7 additions and 1 deletions

View File

@ -44,6 +44,7 @@ def list_purchases(request: HttpRequest) -> HttpResponse:
"data": { "data": {
"columns": [ "columns": [
"Name", "Name",
"Type",
"Platform", "Platform",
"Price", "Price",
"Currency", "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.platform,
purchase.price, purchase.price,
purchase.price_currency, purchase.price_currency,