don't add another _cw_edited_field hidden when build_context is called twice (may occurs with inlined relation forms)
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 18 Jan 2010 11:55:37 +0100
changeset 4248 d375643eea43
parent 4241 da919ea92880
child 4249 222fbf826604
don't add another _cw_edited_field hidden when build_context is called twice (may occurs with inlined relation forms)
web/views/forms.py
--- a/web/views/forms.py	Thu Jan 14 11:14:40 2010 +0100
+++ b/web/views/forms.py	Mon Jan 18 11:55:37 2010 +0100
@@ -250,6 +250,8 @@
         return '%s#%s' % (self._cw.url(), self.domid)
 
     def build_context(self, formvalues=None):
+        if self.formvalues is not None:
+            return # already built
         super(EntityFieldsForm, self).build_context(formvalues)
         edited = set()
         for field in self.fields: