[Erp5-report] r43508 jm - /erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Feb 21 08:22:06 CET 2011


Author: jm
Date: Mon Feb 21 08:22:06 2011
New Revision: 43508

URL: http://svn.erp5.org?rev=43508&view=rev
Log:
On Zope 2.8, ObjectManager._setObject doesn't know 'suppress_events'

Modified:
    erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py

Modified: erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py?rev=43508&r1=43507&r2=43508&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py [utf8] Mon Feb 21 08:22:06 2011
@@ -411,14 +411,16 @@ def _maybe_bootstrap(portal):
     tool_id = tool_class.id
     tool = getattr(portal, tool_id, None)
     if tool is None:
-      portal._setObject(tool_id, tool_class(),
-                        set_owner=False, suppress_events=True)
+      tool = tool_class()
+      try:
+        portal._setObject(tool_id, tool, set_owner=False, suppress_events=True)
+      except TypeError:
+        portal._setObject(tool_id, tool, set_owner=False)
       tool = getattr(portal, tool_id)
     elif not tool._isBootstrapRequired():
       continue
 
     if not bootstrap:
-      migrate = True
       LOG('ERP5Site', INFO, 'bootstrap %s...' % tool_id)
       from Products.ERP5.ERP5Site import getBootstrapDirectory
       bootstrap = getBootstrapDirectory()



More information about the Erp5-report mailing list