From 52016e0806e6b8615b3d2f605ba769c330be1cc0 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 8 Feb 2021 22:14:23 +0100 Subject: [PATCH] policies: skip cache on debug request --- authentik/policies/process.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/authentik/policies/process.py b/authentik/policies/process.py index 4eee182a2..3d12ab3d4 100644 --- a/authentik/policies/process.py +++ b/authentik/policies/process.py @@ -103,8 +103,9 @@ class PolicyProcess(PROCESS_CLASS): # Invert result if policy.negate is set if self.binding.negate: policy_result.passing = not policy_result.passing - key = cache_key(self.binding, self.request) - cache.set(key, policy_result) + if not self.request.debug: + key = cache_key(self.binding, self.request) + cache.set(key, policy_result) LOGGER.debug( "P_ENG(proc): finished and cached ", policy=self.binding.policy,