aboutsummaryrefslogtreecommitdiff
path: root/okupy
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-08-15 00:45:27 +0200
committerMichał Górny <mgorny@gentoo.org>2013-08-17 20:50:51 +0200
commitd936a789ba395e84b9589eb19ee53bcc53431553 (patch)
treee9715dcfa07fd976fdd7728e0e7dd088f2546563 /okupy
parentMerge pull request #61 from mgorny/openid-auto-logout (diff)
downloadidentity.gentoo.org-d936a789ba395e84b9589eb19ee53bcc53431553.tar.gz
identity.gentoo.org-d936a789ba395e84b9589eb19ee53bcc53431553.tar.bz2
identity.gentoo.org-d936a789ba395e84b9589eb19ee53bcc53431553.zip
Fix handling timedeltas in use_nonce().
Diffstat (limited to 'okupy')
-rw-r--r--okupy/accounts/openid_store.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/okupy/accounts/openid_store.py b/okupy/accounts/openid_store.py
index 45cd715..013fcef 100644
--- a/okupy/accounts/openid_store.py
+++ b/okupy/accounts/openid_store.py
@@ -75,7 +75,7 @@ class DjangoDBOpenIDStore(OpenIDStore):
nonce_dt = datetime.datetime.utcfromtimestamp(ts)
nonce_dt = timezone.make_aware(nonce_dt, timezone.utc)
# copy-paste from python-openid's sqlstore
- if abs(nonce_dt - timezone.now()) > nonce.SKEW:
+ if abs((nonce_dt - timezone.now()).total_seconds()) > nonce.SKEW:
return False
objs = db_models.OpenID_Nonce.objects