[Erp5-report] r39866 nicolas.dumazet - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Nov 4 03:48:30 CET 2010


Author: nicolas.dumazet
Date: Thu Nov  4 03:48:29 2010
New Revision: 39866

URL: http://svn.erp5.org?rev=39866&view=rev
Log:
fix lookup of parent_type in aq_portal_type

Bas.aq_portal_type uses aq_key keys: as a result, has_key(parent_portal_type)
would always return False. If we want such a test, we need to test for _aq_key

Modified:
    erp5/trunk/products/ERP5Type/Base.py

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=39866&r1=39865&r2=39866&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Base.py [utf8] Thu Nov  4 03:48:29 2010
@@ -554,11 +554,12 @@ def initializePortalTypeDynamicPropertie
     parent_klass = parent_object.__class__
     parent_type = parent_object.portal_type
     if getattr(parent_klass, 'isRADContent', 0) and \
-       (ptype != parent_type or klass != parent_klass) and \
-       not Base.aq_portal_type.has_key(parent_type):
-      initializePortalTypeDynamicProperties(parent_object, parent_klass,
-                                            parent_type,
-                                            parent_object._aq_key(), portal)
+        (ptype != parent_type or klass != parent_klass):
+      parent_aq_key = parent_object._aq_key()
+      if parent_aq_key not in Base.aq_portal_type:
+        initializePortalTypeDynamicProperties(parent_object, parent_klass,
+                                              parent_type,
+                                              parent_aq_key, portal)
 
     prop_list = list(getattr(klass, '_properties', []))
     cat_list = list(getattr(klass, '_categories', []))




More information about the Erp5-report mailing list