web/views/formrenderers.py
branchstable
changeset 4573 fc6bb020e60e
parent 4380 5613d7c06339
child 4625 d8c3a50a8ee7
--- a/web/views/formrenderers.py	Mon Feb 15 15:11:18 2010 +0100
+++ b/web/views/formrenderers.py	Mon Feb 15 15:11:49 2010 +0100
@@ -92,7 +92,7 @@
         self.render_fields(w, form, values)
         self.render_buttons(w, form)
         w(u'</fieldset>')
-        w(u'</form>')
+        w(self.close_form(form, values))
         errormsg = self.error_message(form)
         if errormsg:
             data.insert(0, errormsg)
@@ -171,6 +171,13 @@
             tag += ' cubicweb:target="%s"' % xml_escape(form.cwtarget)
         return tag + '>'
 
+    def close_form(self, form, values):
+        """seem dump but important for consistency w/ close form, and necessary
+        for form renderers overriding open_form to use something else or more than
+        and <form>
+        """
+        return '</form>'
+
     def render_fields(self, w, form, values):
         fields = self._render_hidden_fields(w, form)
         if fields: