[Erp5-report] r38456 jerome - /erp5/trunk/products/ERP5Type/Accessor/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Sep 17 14:21:19 CEST 2010


Author: jerome
Date: Fri Sep 17 14:21:19 2010
New Revision: 38456

URL: http://svn.erp5.org?rev=38456&view=rev
Log:
don't call _aq_dynamic if not needed (although in most of cases it will be needed)

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

Modified: erp5/trunk/products/ERP5Type/Accessor/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Accessor/Base.py?rev=38456&r1=38455&r2=38456&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Accessor/Base.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Accessor/Base.py [utf8] Fri Sep 17 14:21:19 2010
@@ -114,7 +114,9 @@ class Setter(Method):
         # security on the class for generated methods.
         # We explictly call _aq_dynamic to prevent acquiering the attribute
         # from container
-        roles = getattr(im_self.__class__, name, im_self._aq_dynamic(name))
+        roles = getattr(im_self.__class__, name, im_self)
+        if roles is im_self:
+          roles = im_self._aq_dynamic(name)
         if roles is None:
           return rolesForPermissionOn(None, im_self, ('Manager',),
                                       '_Modify_portal_content_Permission')
@@ -191,7 +193,9 @@ class Getter(Method):
         name = '%s__roles__' % ob.__name__
         # we explictly call _aq_dynamic to prevent acquiering the attribute
         # from container
-        roles = getattr(im_self.__class__, name, im_self._aq_dynamic(name))
+        roles = getattr(im_self.__class__, name, im_self)
+        if roles is im_self:
+          roles = im_self._aq_dynamic(name)
         if roles is None:
           return rolesForPermissionOn(None, im_self, ('Manager',),
                                       '_Access_contents_information_Permission')




More information about the Erp5-report mailing list