From 19d5902a92cabe668fa812e57b70bf9aa7d65222 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 10 Jan 2022 19:49:27 +0100 Subject: [PATCH] flows: handle error if flow title contains invalid format string Signed-off-by: Jens Langhammer --- authentik/flows/stage.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/authentik/flows/stage.py b/authentik/flows/stage.py index 2c7c7e5a7..dc1d8ae37 100644 --- a/authentik/flows/stage.py +++ b/authentik/flows/stage.py @@ -118,9 +118,12 @@ class ChallengeStageView(StageView): """Allow usage of placeholder in flow title.""" if not self.executor.plan: return self.executor.flow.title - return self.executor.flow.title % { - "app": self.executor.plan.context.get(PLAN_CONTEXT_APPLICATION, "") - } + try: + return self.executor.flow.title % { + "app": self.executor.plan.context.get(PLAN_CONTEXT_APPLICATION, "") + } + except ValueError: + return self.executor.flow.title def _get_challenge(self, *args, **kwargs) -> Challenge: with Hub.current.start_span(