allow no values argument tls-sprint
authorsylvain.thenault@logilab.fr
Thu, 09 Apr 2009 12:35:03 +0200
branchtls-sprint
changeset 1312 df7f847e1388
parent 1311 4cc6e2723dc7
child 1313 9cff1eee0208
allow no values argument
web/form.py
--- a/web/form.py	Thu Apr 09 12:34:40 2009 +0200
+++ b/web/form.py	Thu Apr 09 12:35:03 2009 +0200
@@ -282,9 +282,11 @@
         renderer = values.pop('renderer', FormRenderer())
         return renderer.render(self, values)
 
-    def form_build_context(self, values):
+    def form_build_context(self, values=None):
         self.context = context = {}
         # on validation error, we get a dictionnary of previously submitted values
+        if values is None:
+            values = {}
         previous_values = self.req.data.get('formvalues')
         if previous_values:
             values.update(previous_values)