[Erp5-report] r42325 nicolas.dumazet - /erp5/trunk/products/ERP5/ERP5Site.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jan 14 06:44:16 CET 2011
Author: nicolas.dumazet
Date: Fri Jan 14 06:44:16 2011
New Revision: 42325
URL: http://svn.erp5.org?rev=42325&view=rev
Log:
if called very early, the types tool might not be here
Modified:
erp5/trunk/products/ERP5/ERP5Site.py
Modified: erp5/trunk/products/ERP5/ERP5Site.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/ERP5Site.py?rev=42325&r1=42324&r2=42325&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/ERP5Site.py [utf8] (original)
+++ erp5/trunk/products/ERP5/ERP5Site.py [utf8] Fri Jan 14 06:44:16 2011
@@ -1403,11 +1403,12 @@ class ERP5Site(FolderMixIn, CMFSite, Cac
We consider that a Site is migrated if its Types Tool is migrated
(it will always be migrated last)"""
- # XXX do we want to call this automatically? Where? (note that it's likely
- # to fail as portal types are usually not perfectly configured, and it
- # requires user action to fix issues)
- if self.portal_types.__class__.__module__ == 'erp5.portal_type':
- # nothing to do
+ types_tool = getattr(self, 'portal_types', None)
+ if types_tool is None:
+ # empty site
+ return
+ if types_tool.__class__.__module__ == 'erp5.portal_type':
+ # nothing to do, already migrated
return
# note that the site itself is not migrated (ERP5Site is not a portal type)
More information about the Erp5-report
mailing list