From e1a3857de92aa211f1ee9ca213a072d68f87cb83 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 12 Feb 2018 17:07:50 -0500 Subject: [PATCH] Make sure to filtered already-expired tokens from the "expiring soon" tokens --- data/model/appspecifictoken.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/model/appspecifictoken.py b/data/model/appspecifictoken.py index 282fa458c..6b0921bd0 100644 --- a/data/model/appspecifictoken.py +++ b/data/model/appspecifictoken.py @@ -60,7 +60,8 @@ def get_expiring_tokens(user, soon): return (AppSpecificAuthToken .select() .where(AppSpecificAuthToken.user == user, - AppSpecificAuthToken.expiration <= soon_datetime)) + AppSpecificAuthToken.expiration <= soon_datetime, + AppSpecificAuthToken.expiration > datetime.now())) def gc_expired_tokens(user):