summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-10 16:38:07 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-10 16:38:07 +0100
commit4099ec6f9880814bec528fb5a2967b66ae6dd3a0 (patch)
tree78a957ca23a0374709ede31fbc54d1b5c522ce85
parent42f7c1d55b1949c35c3a5e94fb424e49a8a73a99 (diff)
downloadpykolab-4099ec6f9880814bec528fb5a2967b66ae6dd3a0.tar.gz
Correct cache.get_entry() use of strtime (should have been strftime) and Python native datetime objects (we were passing the literal string)
-rw-r--r--pykolab/auth/ldap/cache.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pykolab/auth/ldap/cache.py b/pykolab/auth/ldap/cache.py
index 30f87fe..69c5d8d 100644
--- a/pykolab/auth/ldap/cache.py
+++ b/pykolab/auth/ldap/cache.py
@@ -118,9 +118,10 @@ def get_entry(domain, entry):
db.commit()
_entry = db.query(Entry).filter_by(uniqueid=entry['id']).first()
else:
- if not _entry.last_change.strtime("%Y%m%d%H%M%SZ") == entry['modifytimestamp']:
+ if not _entry.last_change.strftime("%Y%m%d%H%M%SZ") == entry['modifytimestamp']:
log.debug(_("Updating timestamp for cache entry %r") % (entry['id']), level=8)
- entry.last_change = entry['modifytimestamp']
+ last_change = datetime.datetime.strptime(entry['modifytimestamp'], "%Y%m%d%H%M%SZ")
+ _entry.last_change = last_change
db.commit()
_entry = db.query(Entry).filter_by(uniqueid=entry['id']).first()