From 7fbf915e0a3a39e0d26b52fabc0b97bc1aa335d2 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 30 Jan 2021 18:12:01 +0100 Subject: [PATCH] policies: fix application cached not being cleared correctly --- authentik/admin/views/overview.py | 2 +- authentik/policies/signals.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/authentik/admin/views/overview.py b/authentik/admin/views/overview.py index 400e47206..dd9d78e17 100644 --- a/authentik/admin/views/overview.py +++ b/authentik/admin/views/overview.py @@ -28,7 +28,7 @@ class PolicyCacheClearView(AdminRequiredMixin, SuccessMessageMixin, FormView): cache.delete_many(keys) LOGGER.debug("Cleared Policy cache", keys=len(keys)) # Also delete user application cache - keys = user_app_cache_key("*") + keys = cache.keys(user_app_cache_key("*")) cache.delete_many(keys) return super().post(request, *args, **kwargs) diff --git a/authentik/policies/signals.py b/authentik/policies/signals.py index 29f23d8ba..3fabc7202 100644 --- a/authentik/policies/signals.py +++ b/authentik/policies/signals.py @@ -26,5 +26,5 @@ def invalidate_policy_cache(sender, instance, **_): cache.delete_many(keys) LOGGER.debug("Invalidating policy cache", policy=instance, keys=total) # Also delete user application cache - keys = user_app_cache_key("*") + keys = cache.keys(user_app_cache_key("*")) cache.delete_many(keys)