From 9ddb9093427f385130734b641f9cd54314ed37ac Mon Sep 17 00:00:00 2001 From: Kostyantyn Leschenko Date: Tue, 3 Sep 2013 15:32:49 +0300 Subject: [PATCH 1/2] removed unnecessary utcnow call is this code required here? --- flask_security/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flask_security/utils.py b/flask_security/utils.py index a804a06..52c0e55 100644 --- a/flask_security/utils.py +++ b/flask_security/utils.py @@ -206,9 +206,7 @@ def config_value(key, app=None, default=None): def get_max_age(key, app=None): - now = datetime.utcnow() - expires = now + get_within_delta(key + '_WITHIN', app) - td = (expires - now) + td = get_within_delta(key + '_WITHIN', app) return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 1e6) / 1e6 From 5a780ce741fb1726fa4e5f43f11758a19acee947 Mon Sep 17 00:00:00 2001 From: Kostyantyn Leschenko Date: Thu, 5 Sep 2013 18:12:31 +0300 Subject: [PATCH 2/2] simplified get_max_age return value --- flask_security/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_security/utils.py b/flask_security/utils.py index 52c0e55..06effff 100644 --- a/flask_security/utils.py +++ b/flask_security/utils.py @@ -207,7 +207,7 @@ def config_value(key, app=None, default=None): def get_max_age(key, app=None): td = get_within_delta(key + '_WITHIN', app) - return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 1e6) / 1e6 + return td.seconds + td.days * 24 * 3600 def get_within_delta(key, app=None):