From b53c94d76aabb045192bcc18b3c3e0b5b3c8cf88 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 16 Jun 2021 22:52:00 +0200 Subject: [PATCH] flows: fix error when stage has incorrect type Signed-off-by: Jens Langhammer --- authentik/flows/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/authentik/flows/views.py b/authentik/flows/views.py index a8b0d9720..c02396012 100644 --- a/authentik/flows/views.py +++ b/authentik/flows/views.py @@ -164,7 +164,11 @@ class FlowExecutorView(APIView): current_stage=self.current_stage, flow_slug=self.flow.slug, ) - stage_cls = self.current_stage.type + try: + stage_cls = self.current_stage.type + except NotImplementedError as exc: + self._logger.debug("Error getting stage type", exc=exc) + return self.stage_invalid() self.current_stage_view = stage_cls(self) self.current_stage_view.args = self.args self.current_stage_view.kwargs = self.kwargs