policy(major): fix error when policy.negate is enabled

This commit is contained in:
Langhammer, Jens
2019-10-14 15:00:20 +02:00
parent 358e39ced0
commit f1c4a62612
6 changed files with 11 additions and 10 deletions

View File

@ -40,7 +40,7 @@ class PolicyProcess(Process):
policy_result = PolicyResult(False, str(exc))
# Invert result if policy.negate is set
if self.policy.negate:
policy_result = not policy_result
policy_result.passing = not policy_result.passing
LOGGER.debug("Got result", policy=self.policy, result=policy_result,
process="PolicyProcess")
key = cache_key(self.policy, self.request.user)