summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-04 15:13:44 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-04 15:13:44 +0000
commit3ed1abf698a392790637ef6797c15e10c7256077 (patch)
treecca224d13130977d35fc3cfa0dc91ad82a6c47ed
parent7cc23ab6a66a7471fc44a09a47b6d143da4e3d00 (diff)
downloadpykolab-3ed1abf698a392790637ef6797c15e10c7256077.tar.gz
Allow the caller to cache.get_entry() to specify the entry should not be updated automatically
-rw-r--r--pykolab/auth/ldap/cache.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pykolab/auth/ldap/cache.py b/pykolab/auth/ldap/cache.py
index 503c3c5..6688bf7 100644
--- a/pykolab/auth/ldap/cache.py
+++ b/pykolab/auth/ldap/cache.py
@@ -99,12 +99,15 @@ def delete_entry(domain, entry):
db.delete(_entry)
db.commit()
-def get_entry(domain, entry):
+def get_entry(domain, entry, update=True):
result_attribute = conf.get('cyrus-sasl', 'result_attribute')
db = init_db(domain)
_entry = db.query(Entry).filter_by(uniqueid=entry['id']).first()
+ if not update:
+ return _entry
+
if _entry == None:
log.debug(_("Inserting cache entry %r") % (entry['id']), level=8)