[Erp5-report] r42816 nicolas.dumazet - /erp5/trunk/products/ERP5Type/dynamic/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jan 31 14:32:51 CET 2011


Author: nicolas.dumazet
Date: Mon Jan 31 14:32:51 2011
New Revision: 42816

URL: http://svn.erp5.org?rev=42816&view=rev
Log:
pull up getSite() call as site will be used before as well

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

Modified: erp5/trunk/products/ERP5Type/dynamic/lazy_class.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/dynamic/lazy_class.py?rev=42816&r1=42815&r2=42816&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/dynamic/lazy_class.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/dynamic/lazy_class.py [utf8] Mon Jan 31 14:32:51 2011
@@ -213,9 +213,11 @@ class PortalTypeMetaClass(GhostBaseMetaC
 
     ERP5Base.aq_method_lock.acquire()
     portal_type = klass.__name__
+    from Products.ERP5.ERP5Site import getSite
+    site = getSite()
     try:
       try:
-        class_definition = generatePortalTypeClass(portal_type)
+        class_definition = generatePortalTypeClass(site, portal_type)
       except AttributeError:
         LOG("ERP5Type.Dynamic", WARNING,
             "Could not access Portal Type Object for type %r"

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=42816&r1=42815&r2=42816&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py [utf8] Mon Jan 31 14:32:51 2011
@@ -129,16 +129,13 @@ core_portal_type_class_dict = {
                   'generating': False}
   }
 
-def generatePortalTypeClass(portal_type_name):
+def generatePortalTypeClass(site, portal_type_name):
   """
   Given a portal type, look up in Types Tool the corresponding
   Base Type object holding the definition of this portal type,
   and computes __bases__ and __dict__ for the class that will
   be created to represent this portal type
   """
-  from Products.ERP5.ERP5Site import getSite
-  site = getSite()
-
   # LOG("ERP5Type.dynamic", INFO, "Loading portal type " + portal_type_name)
 
   global core_portal_type_class_dict



More information about the Erp5-report mailing list