From 1c686e19b5a4e544c3b192805fed5b1d715314be Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 14 Jan 2021 20:17:21 +0100 Subject: [PATCH] policies: set message instead of error for Event --- authentik/policies/process.py | 4 ++-- web/src/pages/events/EventInfo.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/authentik/policies/process.py b/authentik/policies/process.py index 11b2b651f..88a98116f 100644 --- a/authentik/policies/process.py +++ b/authentik/policies/process.py @@ -76,11 +76,11 @@ class PolicyProcess(Process): try: policy_result = self.binding.policy.passes(self.request) if self.binding.policy.execution_logging: - self.create_event(EventAction.POLICY_EXECUTION, result=policy_result) + self.create_event(EventAction.POLICY_EXECUTION, message="Policy Execution", result=policy_result) except PolicyException as exc: # Create policy exception event error_string = "".join(format_tb(exc.__traceback__)) + str(exc) - self.create_event(EventAction.POLICY_EXCEPTION, error=error_string) + self.create_event(EventAction.POLICY_EXCEPTION, message=error_string) LOGGER.debug("P_ENG(proc): error", exc=exc) policy_result = PolicyResult(False, str(exc)) policy_result.source_policy = self.binding.policy diff --git a/web/src/pages/events/EventInfo.ts b/web/src/pages/events/EventInfo.ts index 763c17960..f172846bc 100644 --- a/web/src/pages/events/EventInfo.ts +++ b/web/src/pages/events/EventInfo.ts @@ -95,7 +95,7 @@ export class EventInfo extends LitElement { return html`

${gettext("Exception")}

- ${this.event.context.error} + ${this.event.context.error || this.event.context.message}

${gettext("Expression")}