[Erp5-report] r17997 - /erp5/trunk/products/ERP5Type/patches/DCWorkflow.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Dec 4 13:32:15 CET 2007
Author: nicolas
Date: Tue Dec 4 13:32:15 2007
New Revision: 17997
URL: http://svn.erp5.org?rev=17997&view=rev
Log:
Check if portal_type_list is not empty
Modified:
erp5/trunk/products/ERP5Type/patches/DCWorkflow.py
Modified: erp5/trunk/products/ERP5Type/patches/DCWorkflow.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/DCWorkflow.py?rev=17997&r1=17996&r2=17997&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/DCWorkflow.py (original)
+++ erp5/trunk/products/ERP5Type/patches/DCWorkflow.py Tue Dec 4 13:32:15 2007
@@ -511,18 +511,20 @@
portal_type_list.append(tid)
elif include_default == 1:
portal_type_list.append(tid)
-
- object_list = self.portal_catalog(portal_type=portal_type_list, limit=None)
- object_list_len = len(object_list)
- portal_activities = self.portal_activities
- object_path_list = [x.path for x in object_list]
- for i in xrange(0, object_list_len, ACTIVITY_GROUPING_COUNT):
- current_path_list = object_path_list[i:i+ACTIVITY_GROUPING_COUNT]
- portal_activities.activate(activity='SQLQueue',
- priority=3)\
- .callMethodOnObjectList(current_path_list,
- 'updateRoleMappingsFor',
- wf_id = self.getId())
+ if portal_type_list:
+ object_list = self.portal_catalog(portal_type=portal_type_list, limit=None)
+ object_list_len = len(object_list)
+ portal_activities = self.portal_activities
+ object_path_list = [x.path for x in object_list]
+ for i in xrange(0, object_list_len, ACTIVITY_GROUPING_COUNT):
+ current_path_list = object_path_list[i:i+ACTIVITY_GROUPING_COUNT]
+ portal_activities.activate(activity='SQLQueue',
+ priority=3)\
+ .callMethodOnObjectList(current_path_list,
+ 'updateRoleMappingsFor',
+ wf_id = self.getId())
+ else:
+ object_list_len = 0
if REQUEST is not None:
return self.manage_properties(REQUEST,
More information about the Erp5-report
mailing list