Commit bf117862 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

do not raise an error if a workflow is missing in the chain, because it can...

do not raise an error if a workflow is missing in the chain, because it can happen when it is removed by another business template.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27761 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d277380e
...@@ -1470,10 +1470,13 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem): ...@@ -1470,10 +1470,13 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
else: else:
workflow_name = workflow workflow_name = workflow
if workflow[0] != '-' and \ if workflow[0] != '-' and \
workflow_name not in chain_dict['chain_%s' % portal_type]: workflow_name not in chain_dict['chain_%s' % portal_type].split(', '):
if not self.is_bt_for_diff: if not self.is_bt_for_diff:
raise NotFound, 'workflow %s not found in chain for portal_type %s'\ # here, we use 'LOG' instead of 'raise', because it can
% (workflow, portal_type) # happen when a workflow is removed from the chain by
# another business template.
LOG('BusinessTemplate', WARNING, 'workflow %s not found in chain for portal_type %s'\
% (workflow, portal_type))
if self._objects.has_key(portal_type): if self._objects.has_key(portal_type):
# other workflow id already defined for this portal type # other workflow id already defined for this portal type
self._objects[portal_type].append(workflow) self._objects[portal_type].append(workflow)
......
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