vocabfunc must be compliant with StaticVocabularyConstraint.vocabulary which takes only keyword parameters
authorKatia Saurfelt <katia.saurfelt@logilab.fr>
Fri, 10 Apr 2009 11:32:32 +0200
changeset 1333 85d1bc9da0ad
parent 1299 dc4f774dc0af
child 1334 0d63ee3096f6
vocabfunc must be compliant with StaticVocabularyConstraint.vocabulary which takes only keyword parameters
web/views/management.py
--- a/web/views/management.py	Wed Apr 08 11:04:47 2009 +0200
+++ b/web/views/management.py	Fri Apr 10 11:32:32 2009 +0200
@@ -159,9 +159,11 @@
         w(u'<tr><th>%s</th><th>%s</th><th>%s</th><th>&nbsp;</th></tr>\n'
                % (_("name"), _("label"), _('granted to groups')))
         if getattr(entity, '__permissions__', None):
+            # vocabfunc must be compliant with StaticVocabularyConstraint.vocabulary
+            # which takes only keyword parameters
             wdg = StaticComboBoxWidget(self.vreg, self.schema['EPermission'],
                                        self.schema['name'], self.schema['String'],
-                                       vocabfunc=lambda x: entity.__permissions__)
+                                       vocabfunc=lambda entity, x=entity: x.__permissions__)
         else:
             wdg = newperm.get_widget('name')
         w(u'<tr><td>%s</td>\n' % wdg.edit_render(newperm))