From cf152365cd68ffa7572efa2777faf7057dccb044 Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Fri, 13 Mar 2015 10:47:30 -0700 Subject: [PATCH] Instance overview renders erroneous markup Under Instance Detail | Overview | Meta | Key Name an unclosed is rendered for an instance launched without an associated key pair. This seems to be reproducible using Django 1.6.1 in local devstack. The issue seems to be that Django's implementation of the add filter has an issue concatenating a string and a function to localize text. Since that fails and returns an empty string which subsequently is added to the closing tag, the closing tag is the only thing that is displayed. This fix saves the localized value to a variable which is then used in the add filter. Closes-Bug: #1423797 Change-Id: I4452ca4a902bbaf19ae5b2bd9bcbe2900069ac3b --- .../instances/templates/instances/_detail_overview.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html index 7933a0d32b..569c3a6d21 100644 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html +++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html @@ -107,8 +107,9 @@
{% trans "Key Name" %}
- {% with default_key_name=""|add:_("None")|add:"" %} -
{{ instance.key_name|default:default_key_name }}
+ {% trans "None" as default_key_name %} + {% with formatted_default_key_name=""|add:default_key_name|add:"" %} +
{{ instance.key_name|default:formatted_default_key_name }}
{% endwith %} {% url 'horizon:project:images:images:detail' instance.image.id as image_url %}
{% trans "Image Name" %}