Commit fac9d756 authored by Nicolas Delaby's avatar Nicolas Delaby

Check if portal_type_list is not empty

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17997 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 747dd81c
...@@ -511,18 +511,20 @@ def updateRoleMappings(self, REQUEST=None): ...@@ -511,18 +511,20 @@ def updateRoleMappings(self, REQUEST=None):
portal_type_list.append(tid) portal_type_list.append(tid)
elif include_default == 1: elif include_default == 1:
portal_type_list.append(tid) portal_type_list.append(tid)
if portal_type_list:
object_list = self.portal_catalog(portal_type=portal_type_list, limit=None) object_list = self.portal_catalog(portal_type=portal_type_list, limit=None)
object_list_len = len(object_list) object_list_len = len(object_list)
portal_activities = self.portal_activities portal_activities = self.portal_activities
object_path_list = [x.path for x in object_list] object_path_list = [x.path for x in object_list]
for i in xrange(0, object_list_len, ACTIVITY_GROUPING_COUNT): for i in xrange(0, object_list_len, ACTIVITY_GROUPING_COUNT):
current_path_list = object_path_list[i:i+ACTIVITY_GROUPING_COUNT] current_path_list = object_path_list[i:i+ACTIVITY_GROUPING_COUNT]
portal_activities.activate(activity='SQLQueue', portal_activities.activate(activity='SQLQueue',
priority=3)\ priority=3)\
.callMethodOnObjectList(current_path_list, .callMethodOnObjectList(current_path_list,
'updateRoleMappingsFor', 'updateRoleMappingsFor',
wf_id = self.getId()) wf_id = self.getId())
else:
object_list_len = 0
if REQUEST is not None: if REQUEST is not None:
return self.manage_properties(REQUEST, return self.manage_properties(REQUEST,
......
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