--- a/web/formfields.py Tue Jun 28 17:59:31 2011 +0200
+++ b/web/formfields.py Wed Jun 29 16:04:01 2011 +0200
@@ -1,4 +1,4 @@
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
@@ -387,12 +387,11 @@
"""
assert self.choices is not None
if callable(self.choices):
- try:
- if getattr(self.choices, 'im_self', None) is self:
- vocab = self.choices(form=form, **kwargs)
- else:
- vocab = self.choices(form=form, field=self, **kwargs)
- except TypeError:
+ if getattr(self.choices, 'im_self', None) is self:
+ vocab = self.choices(form=form, **kwargs)
+ elif support_args(self.choices, 'form', 'field'):
+ vocab = self.choices(form=form, field=self, **kwargs)
+ else:
try:
vocab = self.choices(form=form, **kwargs)
warn('[3.6] %s: choices should now take '