Commit acfcc288 authored by Aurel's avatar Aurel

don't fail if portal type not found when installing roles


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6487 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 361815ce
...@@ -1897,7 +1897,8 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem): ...@@ -1897,7 +1897,8 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem):
if action == 'nothing': if action == 'nothing':
continue continue
path = 'portal_types/%s' % roles_path.split('/', 1)[1] path = 'portal_types/%s' % roles_path.split('/', 1)[1]
obj = p.unrestrictedTraverse(path) obj = p.unrestrictedTraverse(path, None)
if obj is not None:
setattr(obj, '_roles', []) # reset roles before applying setattr(obj, '_roles', []) # reset roles before applying
type_roles_list = self._objects[roles_path] or [] type_roles_list = self._objects[roles_path] or []
for type_role_property_dict in type_roles_list: for type_role_property_dict in type_roles_list:
......
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