Commit 5920200d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

simplify r35954 (instance.getPortalObject() raises AttributeError if instance...

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


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35956 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 35ce51c1
...@@ -169,11 +169,8 @@ class WorkflowMethod(Method): ...@@ -169,11 +169,8 @@ 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
try: try:
wf = getToolByName(instance.getPortalObject(), 'portal_workflow', None) wf = getToolByName(instance.getPortalObject(), 'portal_workflow')
except AttributeError: except AttributeError:
wf = getToolByName(instance, 'portal_workflow', None)
if wf is None:
# XXX instance is unwrapped(no acquisition) # XXX instance is unwrapped(no acquisition)
# XXX I must think that what is a correct behavior.(Yusei) # XXX I must think that what is a correct behavior.(Yusei)
return self._m(instance, *args, **kw) return self._m(instance, *args, **kw)
......
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