Commit 08b88b0d authored by wenjie.zheng's avatar wenjie.zheng

Workflow.py: slight improvement.

parent fb2ad729
......@@ -349,7 +349,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if document is not None:
if document.getTypeInfo() is not None:
for workflow_id in document.getTypeInfo().getTypeWorkflowList():
append(document.getTypeInfo().getId())
append(document.getPortalType())
return result
_getPortalTypeListForWorkflow = CachingMethod(getPortalTypeListForWorkflow,
......@@ -375,7 +375,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if isinstance(evaluated_value, (str, int, long)):
evaluated_value = [str(evaluated_value)]
else:
evaluated_value = [str(x) % info for x in var]
evaluated_value = [x % info for x in var]
variable_match[key] = evaluated_value
if 'portal_type' in variable_match and len(variable_match['portal_type']):
......@@ -395,11 +395,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
elif (not check_guard) or \
Guard_checkWithoutRoles(guard, security_manager, self, portal):
is_permitted_worklist = 1
workflow_role_list = worklist_definition.getRoleList()
if workflow_role_list is not None:
variable_match[SECURITY_PARAMETER_ID] = workflow_role_list
else:
variable_match[SECURITY_PARAMETER_ID] = ()
variable_match[SECURITY_PARAMETER_ID] = guard.roles
if is_permitted_worklist:
fmt_data = TemplateDict()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment