summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-22 13:50:41 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-22 13:50:41 +0200
commitcdf8599b29826b815bc14f7a4c6b07c628678366 (patch)
tree158378ff535169fec86affc65f38020317c11e28
parent7fa0dbb264dcf1f95d3166d96ac997a3f368a579 (diff)
downloadpykolab-cdf8599b29826b815bc14f7a4c6b07c628678366.tar.gz
Only obtain the value of the cache_entry if the entry supplied in the callback does not already have a result attribute value
-rw-r--r--pykolab/auth/ldap/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index b8afa9c..6559ea0 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -2023,11 +2023,12 @@ class LDAP(pykolab.base.Base):
# See if we can find the cache entry - this way we can get to
# the value of a (former, on a deleted entry) result_attribute
- cache_entry = cache.get_entry(self.domain, entry, update=False)
result_attribute = conf.get('cyrus-sasl', 'result_attribute')
+ if not entry.has_key(result_attribute):
+ cache_entry = cache.get_entry(self.domain, entry, update=False)
- if hasattr(cache_entry, 'result_attribute') and change == 'delete':
- entry[result_attribute] = cache_entry.result_attribute
+ if hasattr(cache_entry, 'result_attribute') and change == 'delete':
+ entry[result_attribute] = cache_entry.result_attribute
eval(
"self._change_%s_%s(entry, change_dict)" % (