Commit 8cc2ef25 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

instance.getPortalObject() raises AttributeError if instance is just created...

instance.getPortalObject() raises AttributeError if instance is just created by manage_pasteObject().


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35954 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 412c9038
...@@ -168,7 +168,10 @@ class WorkflowMethod(Method): ...@@ -168,7 +168,10 @@ class WorkflowMethod(Method):
# New implementation does not use any longer wrapWorkflowMethod # New implementation does not use any longer wrapWorkflowMethod
# but directly calls the workflow methods # but directly calls the workflow methods
wf = getToolByName(instance.getPortalObject(), 'portal_workflow', None) try:
wf = getToolByName(instance.getPortalObject(), 'portal_workflow', None)
except AttributeError:
wf = getToolByName(instance, 'portal_workflow', None)
if wf is None: if wf is None:
# XXX instance is unwrapped(no acquisition) # XXX instance is unwrapped(no acquisition)
......
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