Commit 7a7d876b authored by Yoshinori Okuji's avatar Yoshinori Okuji

Do not pass self to _getPreference, because this can make the caching inefficient.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4393 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8a3fba8a
...@@ -83,7 +83,7 @@ class PreferenceTool(BaseTool): ...@@ -83,7 +83,7 @@ class PreferenceTool(BaseTool):
security.declareProtected(Permissions.View, "getPreference") security.declareProtected(Permissions.View, "getPreference")
def getPreference(self, pref_name) : def getPreference(self, pref_name) :
""" get the preference on the most appopriate Preference object. """ """ get the preference on the most appopriate Preference object. """
def _getPreference(self, pref_name="", user_name="") : def _getPreference(pref_name="", user_name="") :
found = 0 found = 0
MARKER = [] MARKER = []
for pref in self._getMostAppropriatePreferences() : for pref in self._getMostAppropriatePreferences() :
...@@ -102,7 +102,7 @@ class PreferenceTool(BaseTool): ...@@ -102,7 +102,7 @@ class PreferenceTool(BaseTool):
_getPreference = CachingMethod( _getPreference, _getPreference = CachingMethod( _getPreference,
id='PreferenceTool.CachingMethod') id='PreferenceTool.CachingMethod')
user_name = getSecurityManager().getUser().getId() user_name = getSecurityManager().getUser().getId()
return _getPreference(self, pref_name=pref_name, user_name=user_name) return _getPreference(pref_name=pref_name, user_name=user_name)
security.declareProtected(Permissions.ModifyPortalContent, "setPreference") security.declareProtected(Permissions.ModifyPortalContent, "setPreference")
def setPreference(self, pref_name, value) : def setPreference(self, pref_name, value) :
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment