[Erp5-report] r42941 nicolas.dumazet - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Feb 2 17:12:53 CET 2011


Author: nicolas.dumazet
Date: Wed Feb  2 17:12:53 2011
New Revision: 42941

URL: http://svn.erp5.org?rev=42941&view=rev
Log:
do not iterate over a changing dict.

Behavior depends on hash orders, hence the success of the migration
test in testBusinessTemplate, and the bad failures at some other places

Modified:
    erp5/trunk/products/ERP5/Document/BusinessTemplate.py

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=42941&r1=42940&r2=42941&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Wed Feb  2 17:12:53 2011
@@ -3625,7 +3625,9 @@ class PropertySheetTemplateItem(Document
     property_sheet_tool = context.getPortalObject().portal_property_sheets
     property_sheet_id_set = set(property_sheet_tool.objectIds())
 
-    for class_id in migrate_object_dict:
+    # careful, that dictionary will change
+    class_id_list = migrate_object_dict.keys()
+    for class_id in class_id_list:
       # If the Property Sheet already exists in ZODB, then skip it,
       # otherwise it should not be needed anymore once the deletion
       # code of the filesystem Property Sheets is enabled



More information about the Erp5-report mailing list