policies: skip cache on debug request

This commit is contained in:
Jens Langhammer 2021-02-08 22:14:23 +01:00
parent e555bdd42b
commit 52016e0806
1 changed files with 3 additions and 2 deletions

View File

@ -103,6 +103,7 @@ class PolicyProcess(PROCESS_CLASS):
# Invert result if policy.negate is set
if self.binding.negate:
policy_result.passing = not policy_result.passing
if not self.request.debug:
key = cache_key(self.binding, self.request)
cache.set(key, policy_result)
LOGGER.debug(