[cwprops] fix callable vocabulary of cwproperties which were inconsistently called. No more argument, should now simply return a list of (untranslated) values
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 04 Aug 2010 11:16:40 +0200
changeset 6069 d7cef08aad27
parent 6068 3bbc79a39d3a
child 6077 62011f82c386
[cwprops] fix callable vocabulary of cwproperties which were inconsistently called. No more argument, should now simply return a list of (untranslated) values
cwvreg.py
web/views/cwproperties.py
--- a/cwvreg.py	Wed Aug 04 11:16:39 2010 +0200
+++ b/cwvreg.py	Wed Aug 04 11:16:40 2010 +0200
@@ -713,7 +713,7 @@
         vocab = pdef['vocabulary']
         if vocab is not None:
             if callable(vocab):
-                vocab = vocab(key, None) # XXX need a req object
+                vocab = vocab(None) # XXX need a req object
             if not value in vocab:
                 raise ValueError(_('unauthorized value'))
         return value
--- a/web/views/cwproperties.py	Wed Aug 04 11:16:39 2010 +0200
+++ b/web/views/cwproperties.py	Wed Aug 04 11:16:40 2010 +0200
@@ -353,7 +353,7 @@
         if vocab is not None:
             if callable(vocab):
                 # list() just in case its a generator function
-                self.choices = list(vocab(form._cw))
+                self.choices = list(vocab())
             else:
                 self.choices = vocab
             wdg = Select()