pykolab/auth

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Wed May 22 13:51:23 CEST 2013


 pykolab/auth/ldap/__init__.py |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit cdf8599b29826b815bc14f7a4c6b07c628678366
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed May 22 13:50:41 2013 +0200

    Only obtain the value of the cache_entry if the entry supplied in the callback does not already have a result attribute value

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)" % (





More information about the commits mailing list