[inlined formos] don't pop attributes from kwargs, so they end-up in stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 15 Feb 2010 17:47:50 +0100
branchstable
changeset 4585 912aba7e6400
parent 4584 eef17cfcfa9c
child 4586 440e340c61fe
[inlined formos] don't pop attributes from kwargs, so they end-up in cw_extra_kwargs which is then passed to the edition form
web/views/autoform.py
--- a/web/views/autoform.py	Mon Feb 15 15:22:01 2010 +0100
+++ b/web/views/autoform.py	Mon Feb 15 17:47:50 2010 +0100
@@ -85,7 +85,10 @@
 
     def __init__(self, *args, **kwargs):
         for attr in self._select_attrs:
-            setattr(self, attr, kwargs.pop(attr, None))
+            # don't pop attributes from kwargs, so the end-up in
+            # self.cw_extra_kwargs which is then passed to the edition form (see
+            # the .form method)
+            setattr(self, attr, kwargs.get(attr))
         super(InlineEntityEditionFormView, self).__init__(*args, **kwargs)
 
     def _entity(self):