[form] only set __form_id for the main form, not for sub-forms. Should fix regression introduced by 4668:9f82f81bf13d stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Feb 2010 11:11:27 +0100
branchstable
changeset 4683 c375d50eaad3
parent 4682 4994901b7379
child 4684 876a79ece6f7
child 4685 8a2d3a7f62d1
[form] only set __form_id for the main form, not for sub-forms. Should fix regression introduced by 4668:9f82f81bf13d
web/form.py
--- a/web/form.py	Wed Feb 24 11:05:01 2010 +0100
+++ b/web/form.py	Wed Feb 24 11:11:27 2010 +0100
@@ -80,7 +80,8 @@
                  submitmsg=None, mainform=True, **kwargs):
         super(Form, self).__init__(req, rset=rset, row=row, col=col)
         self.fields = list(self.__class__._fields_)
-        self.add_hidden(u'__form_id', kwargs.pop('formvid', self.__regid__))
+        if mainform:
+            self.add_hidden(u'__form_id', kwargs.pop('formvid', self.__regid__))
         for key, val in kwargs.iteritems():
             if key in controller.NAV_FORM_PARAMETERS:
                 self.add_hidden(key, val)