only let user select 'available' workflow items
This commit is contained in:
parent
06c071bdb5
commit
fedd8a3ed9
|
@ -193,7 +193,7 @@ class WorkflowStatusPage(Directory):
|
|||
|
||||
def get_new_item_form [html] (self):
|
||||
form = Form(enctype='multipart/form-data', action = 'newitem')
|
||||
options = [(x.key, _(x.description)) for x in item_classes]
|
||||
options = [(x.key, _(x.description)) for x in item_classes if x.is_available()]
|
||||
options.sort(cmp=lambda a, b: cmp(a[1],b[1]))
|
||||
form.add(SingleSelectWidget, 'type', title = _('Type'),
|
||||
required=True, options = options)
|
||||
|
|
|
@ -334,6 +334,10 @@ class WorkflowStatusItem:
|
|||
pass
|
||||
init = classmethod(init)
|
||||
|
||||
def is_available(cls):
|
||||
return True
|
||||
is_available = classmethod(is_available)
|
||||
|
||||
def render_as_line(self):
|
||||
return _(self.description)
|
||||
|
||||
|
|
Loading…
Reference in New Issue