diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-08-15 00:45:27 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-08-17 20:50:51 +0200 |
commit | d936a789ba395e84b9589eb19ee53bcc53431553 (patch) | |
tree | e9715dcfa07fd976fdd7728e0e7dd088f2546563 /okupy/accounts/openid_store.py | |
parent | Merge pull request #61 from mgorny/openid-auto-logout (diff) | |
download | identity.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/accounts/openid_store.py')
-rw-r--r-- | okupy/accounts/openid_store.py | 2 |
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 |