Corrected inner form template for contexts with empty name
authorThierry Florac <thierry.florac@onf.fr>
Wed, 29 Nov 2017 10:31:38 +0100
changeset 72 8969b8950fed
parent 71 3de99bc70b7a
child 73 d07ddd028cd0
Corrected inner form template for contexts with empty name
src/pyams_form/templates/inner-form.pt
--- a/src/pyams_form/templates/inner-form.pt	Fri Nov 10 13:26:22 2017 +0100
+++ b/src/pyams_form/templates/inner-form.pt	Wed Nov 29 10:31:38 2017 +0100
@@ -1,5 +1,5 @@
 <div class="no-padding"
-	 tal:define="content_name getattr(view.getContent(), '__name__', 'noname').replace('++', '');"
+	 tal:define="content_name (getattr(view.getContent(), '__name__', None) or 'noname').replace('++', '');"
 	 tal:attributes="class string:${view.css_class} ${view.padding_class | default};
 					 id string:${context.__class__.__name__}_${content_name}_${view.id};">
 	<div tal:define="prefix provider:form_prefix"