Commit 4a6270be authored by Nicolas Delaby's avatar Nicolas Delaby

Be more tolerant to access object which can be allready deleted

if its parent is removed before.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34067 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 591e849e
...@@ -1137,7 +1137,10 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -1137,7 +1137,10 @@ class ObjectTemplateItem(BaseTemplateItem):
if recursive_path in update_dict: if recursive_path in update_dict:
action = update_dict[recursive_path] action = update_dict[recursive_path]
if action in ('remove', 'save_and_remove'): if action in ('remove', 'save_and_remove'):
document = portal.restrictedTraverse(recursive_path) document = portal.restrictedTraverse(recursive_path, None)
if document is None:
# It happens if the parent of target path is removed before
continue
if getattr(aq_base(document), 'getParentValue', None) is not None: if getattr(aq_base(document), 'getParentValue', None) is not None:
# regular ERP5 object # regular ERP5 object
parent = document.getParentValue() parent = document.getParentValue()
......
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