Django 4.2: Adjust instance detail template
The template for the instance detail overview uses Django template filters to define a default value for metadata with an empty value. This usage looks magic and does not work with Django 4.2. It looks like this is an undocumented/unspecified behavior. This commit changes it to use {% if %} template syntax instead of depending on the unspcified behavior. Closes-Bug: #2040129 Change-Id: Ida5b2a721f2657347c174e386d2e023dffd64b1b
This commit is contained in:
parent
8770753fcc
commit
5c61331ff2
|
@ -146,12 +146,14 @@
|
||||||
<dt>{% trans "Image" %}</dt>
|
<dt>{% trans "Image" %}</dt>
|
||||||
<dd>{% trans "None" %}</dd>
|
<dd>{% trans "None" %}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% with default_item_value="<em>"|add:_("N/A")|add:"</em>" %}
|
|
||||||
{% for key, value in instance.metadata.items %}
|
{% for key, value in instance.metadata.items %}
|
||||||
<dt>{{ key }}</dt>
|
<dt>{{ key }}</dt>
|
||||||
<dd>{{ value|default:default_item_value }}</dd>
|
{% if value %}
|
||||||
|
<dd>{{ value }}</dd>
|
||||||
|
{% else %}
|
||||||
|
<dd><em>{% trans "N/A" %}</em></dd>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endwith %}
|
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<h4>{% trans "Volumes Attached" %}</h4>
|
<h4>{% trans "Volumes Attached" %}</h4>
|
||||||
|
|
Loading…
Reference in New Issue