From e597bb45420211c9aa23edd6999e89c5377796f3 Mon Sep 17 00:00:00 2001 From: "Matthew R. McDougal" <24367033+mmdoogie@users.noreply.github.com> Date: Mon, 29 Nov 2021 03:35:17 -0600 Subject: [PATCH] policies/expression: fix ak_user_has_authenticator evaluation when not specifying optional device_type (#1849) * Fix ak_user_has_authenticator evaluation when not specifying optional device_type * Simpler patch --- authentik/policies/expression/evaluator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentik/policies/expression/evaluator.py b/authentik/policies/expression/evaluator.py index 25b70292e..6d7fa59c6 100644 --- a/authentik/policies/expression/evaluator.py +++ b/authentik/policies/expression/evaluator.py @@ -50,7 +50,7 @@ class PolicyEvaluator(BaseEvaluator): if device_class == device_type: return True return False - return len(user_devices) > 0 + return len(list(user_devices)) > 0 def set_policy_request(self, request: PolicyRequest): """Update context based on policy request (if http request is given, update that too)"""