Commit cc9c7c37 authored by Nicolas Delaby's avatar Nicolas Delaby

Do not fail if document on which you try to delete local_roles

has been removed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45182 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 11cb5acc
......@@ -4238,9 +4238,12 @@ class LocalRolesTemplateItem(BaseTemplateItem):
keys = self._objects.keys()
for roles_path in keys:
path = roles_path.split('/')[1:]
obj = p.unrestrictedTraverse(path)
setattr(obj, '__ac_local_roles__', {})
obj.reindexObject()
# if document does not exists anymore longer,
# there is no needs to fail
obj = p.unrestrictedTraverse(path, None)
if obj is not None:
setattr(obj, '__ac_local_roles__', {})
obj.reindexObject()
class BusinessTemplate(XMLObject):
"""
......
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