[cwprops] fix callable vocabulary of cwproperties which were inconsistently called. No more argument, should now simply return a list of (untranslated) values
--- 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()