remove item_types module variable, not required
This commit is contained in:
parent
9c9be4927f
commit
2d353e869c
|
@ -192,7 +192,7 @@ class WorkflowStatusPage(Directory):
|
|||
'<div id="new-field">'
|
||||
'<h3>%s</h3>' % _('New Item')
|
||||
form = Form(enctype='multipart/form-data', action = 'newitem')
|
||||
options = [(x, _(y)) for x,y in item_types]
|
||||
options = [(x.key, _(x.description)) for x in item_classes]
|
||||
options.sort(cmp=lambda a, b: cmp(a[1],b[1]))
|
||||
form.add(SingleSelectWidget, 'type', title = _('Type'),
|
||||
required=True, options = options)
|
||||
|
@ -211,7 +211,7 @@ class WorkflowStatusPage(Directory):
|
|||
def newitem(self):
|
||||
form = Form(enctype='multipart/form-data', action = 'newitem')
|
||||
form.add(SingleSelectWidget, 'type', title = _('Type'),
|
||||
options = [(x, _(y)) for x,y in item_types])
|
||||
options = [(x.key, _(x.description)) for x in item_classes])
|
||||
|
||||
if not form.is_submitted() or form.has_errors():
|
||||
get_session().message = ('error', _('Submitted form was not filled properly.'))
|
||||
|
|
|
@ -476,12 +476,10 @@ def render_list_of_roles(roles):
|
|||
return ', '.join(t)
|
||||
|
||||
item_classes = []
|
||||
item_types = []
|
||||
|
||||
def register_item_class(klass):
|
||||
if not klass in item_classes:
|
||||
item_classes.append(klass)
|
||||
item_types.append((klass.key, klass.description))
|
||||
klass.init()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue