From cca33a74b60db3594edf2dd7ad9c7d01fd6f896a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 10 Apr 2022 17:53:46 +0200 Subject: [PATCH] core: fix error when checking generated users with no expiry Signed-off-by: Jens Langhammer --- authentik/core/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentik/core/tasks.py b/authentik/core/tasks.py index 9cbcb1294..ad46bf40f 100644 --- a/authentik/core/tasks.py +++ b/authentik/core/tasks.py @@ -60,7 +60,7 @@ def clean_temporary_users(self: MonitoredTask): messages = [] deleted_users = 0 for user in User.objects.filter(**{f"attributes__{USER_ATTRIBUTE_GENERATED}": True}): - if USER_ATTRIBUTE_EXPIRES not in user.attributes: + if not user.attributes.get(USER_ATTRIBUTE_EXPIRES): continue delta: timedelta = _now - datetime.fromtimestamp( user.attributes.get(USER_ATTRIBUTE_EXPIRES)