From 2661d6efd88b030d380bc7d849bfdf8dbc65f326 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Thu, 30 May 2024 08:31:48 +0000 Subject: [PATCH] Display full display name for non-admissions type T-shirt sizes are in parentheses, and it's not very useful telling the shop to just issue an arbitrary size t-shirt if we're trying to do stock control. --- models/product.py | 2 ++ templates/arrivals/checkin.html | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/models/product.py b/models/product.py index 94f156223..c44168aeb 100644 --- a/models/product.py +++ b/models/product.py @@ -333,6 +333,8 @@ def is_adult_ticket(self) -> bool: @property def checkin_display_name(self): + if self.parent.type != "admissions": + return self.display_name return re.sub(r" \(.*\)", "", self.display_name) def get_price_tier(self, name): diff --git a/templates/arrivals/checkin.html b/templates/arrivals/checkin.html index 6bb4d9f8c..586e9f1bf 100644 --- a/templates/arrivals/checkin.html +++ b/templates/arrivals/checkin.html @@ -114,7 +114,7 @@

Transferred purchases

{% for purchase in transferred_purchases %} {{ purchase.id }} - {{ purchase.product.display_name }} + {{ purchase.product.checkin_display_name }} {{ purchase.owner.name }} {%- if purchase.redeemed %} @@ -153,7 +153,7 @@

Other purchases

{% for purchase in other_purchases %} {{ purchase.id }} - {{ purchase.product.display_name }} + {{ purchase.product.checkin_display_name }} {%- if purchase.redeemed %} Redeemed {{ purchase.redemption_version().transaction.issued_at.strftime('%A %H:%M') }}