Guard customer_approved null/None in all templates
Some rows (schema drift, cancelled requests, manual status edits) have customer_approved = NULL instead of the default 'none'. Templates called .upper() on it blindly, causing a Jinja2 UndefinedError / 500 when the customer player or admin pages loaded. Replace all .upper() calls with (value or 'none').upper() and add truthy checks before rendering the approved choice in status.html and dashboard.html.
This commit is contained in:
parent
9524a24715
commit
2b46f7d3dc
5 changed files with 6 additions and 6 deletions
|
|
@ -168,8 +168,8 @@
|
|||
<h3>Request #{{ req.id }} — {{ req.name }}</h3>
|
||||
<p><strong>Status:</strong> <span class="status {{ req.status }}">{{ statuses[req.status] }}</span></p>
|
||||
|
||||
{% if req.customer_approved != 'none' %}
|
||||
<p class="approved">You selected: {% if req.customer_approved == 'both' %}Both Versions{% else %}Version {{ req.customer_approved.upper() }}{% endif %}</p>
|
||||
{% if req.customer_approved and req.customer_approved != 'none' %}
|
||||
<p class="approved">You selected: {% if req.customer_approved == 'both' %}Both Versions{% else %}Version {{ (req.customer_approved or 'none').upper() }}{% endif %}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if req.song_a_path and req.song_b_path %}
|
||||
|
|
|
|||
Reference in a new issue