Commit 215be608 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! ERP5Workflow: DC Workflows are now ERP5 objects (!1378).

fix convertToERP5Workflow() for the case where permission_roles is not yet configured.
parent 8ece59e2
...@@ -1024,12 +1024,16 @@ def convertToERP5Workflow(self, temp_object=False): ...@@ -1024,12 +1024,16 @@ def convertToERP5Workflow(self, temp_object=False):
acquire_permission_list = [] acquire_permission_list = []
permission_roles_dict = {} permission_roles_dict = {}
if sdef.permission_roles: permission_roles = sdef.permission_roles or {}
for (permission, roles) in sdef.permission_roles.items(): for permission in self.permissions:
if permission in self.permissions: roles = permission_roles.get(permission, None)
if isinstance(roles, list): # type 'list' means acquisition if roles is None:
acquire_permission_list.append(permission) acquire_permission_list.append(permission)
permission_roles_dict[permission] = list(roles) permission_roles_dict[permission] = ()
else:
if isinstance(roles, list): # type 'list' means acquisition
acquire_permission_list.append(permission)
permission_roles_dict[permission] = list(roles)
state.setAcquirePermission(acquire_permission_list) state.setAcquirePermission(acquire_permission_list)
state.setStatePermissionRoleListDict(permission_roles_dict) state.setStatePermissionRoleListDict(permission_roles_dict)
......
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