[Erp5-report] r11595 - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Dec 4 11:01:42 CET 2006


Author: aurel
Date: Mon Dec  4 11:01:41 2006
New Revision: 11595

URL: http://svn.erp5.org?rev=11595&view=rev
Log:
do not use getattr with aq_base, thus we keep acquisition on context
when getting object, rather test before if object without acquisition hold the
attribute

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=11595&r1=11594&r2=11595&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py (original)
+++ erp5/trunk/products/ERP5Type/Base.py Mon Dec  4 11:01:41 2006
@@ -649,8 +649,14 @@
 
     if storage_id is None: storage_id=key
     #LOG("Get Acquired Property storage_id",0,str(storage_id))
+    # Test presence of attribute without acquisition
+    # if present, get it in its context, thus we keep acquisition if
+    # returned value is an object
+    if hasattr(aq_base(self), storage_id):
+      value = getattr(self, storage_id, None)
+    else:
+      value = None
     # If we hold an attribute and mask_value is set, return the attribute
-    value = getattr(aq_base(self), storage_id, None)
     if mask_value and value is not None:
       # Pop context
       del TRANSACTION._erp5_acquisition_stack[acquisition_key]




More information about the Erp5-report mailing list