web/views/formrenderers.py
changeset 4587 70d47389630c
parent 4573 fc6bb020e60e
child 4625 d8c3a50a8ee7
--- a/web/views/formrenderers.py	Thu Feb 11 12:19:08 2010 +0100
+++ b/web/views/formrenderers.py	Mon Feb 15 18:44:47 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: