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:51:18 +0200
commit38023876abbdb0dcea25d56c8e3e6277ec13f80a (patch)
treeffe8751f05adb7a9bf2d1ce47924720025b46039
parent93e28ab95f665c0e484de306b10bd9b11099b387 (diff)
downloadpykolab-38023876abbdb0dcea25d56c8e3e6277ec13f80a.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 118a6d8..b1b01bb 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -1773,11 +1773,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)" % (