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): ...@@ -349,7 +349,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if document is not None: if document is not None:
if document.getTypeInfo() is not None: if document.getTypeInfo() is not None:
for workflow_id in document.getTypeInfo().getTypeWorkflowList(): for workflow_id in document.getTypeInfo().getTypeWorkflowList():
append(document.getTypeInfo().getId()) append(document.getPortalType())
return result return result
_getPortalTypeListForWorkflow = CachingMethod(getPortalTypeListForWorkflow, _getPortalTypeListForWorkflow = CachingMethod(getPortalTypeListForWorkflow,
...@@ -375,7 +375,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -375,7 +375,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if isinstance(evaluated_value, (str, int, long)): if isinstance(evaluated_value, (str, int, long)):
evaluated_value = [str(evaluated_value)] evaluated_value = [str(evaluated_value)]
else: else:
evaluated_value = [str(x) % info for x in var] evaluated_value = [x % info for x in var]
variable_match[key] = evaluated_value variable_match[key] = evaluated_value
if 'portal_type' in variable_match and len(variable_match['portal_type']): if 'portal_type' in variable_match and len(variable_match['portal_type']):
...@@ -395,11 +395,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -395,11 +395,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
elif (not check_guard) or \ elif (not check_guard) or \
Guard_checkWithoutRoles(guard, security_manager, self, portal): Guard_checkWithoutRoles(guard, security_manager, self, portal):
is_permitted_worklist = 1 is_permitted_worklist = 1
workflow_role_list = worklist_definition.getRoleList() variable_match[SECURITY_PARAMETER_ID] = guard.roles
if workflow_role_list is not None:
variable_match[SECURITY_PARAMETER_ID] = workflow_role_list
else:
variable_match[SECURITY_PARAMETER_ID] = ()
if is_permitted_worklist: if is_permitted_worklist:
fmt_data = TemplateDict() 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