From 05a5b5b675d92c0e3c3021bc4bf8edfd6eeaa19f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 27 Feb 2021 21:03:57 +0100 Subject: [PATCH] stages/prompt: fix fields not being sorted correctly --- authentik/stages/prompt/stage.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/authentik/stages/prompt/stage.py b/authentik/stages/prompt/stage.py index 02965dd21..d6ca1e65b 100644 --- a/authentik/stages/prompt/stage.py +++ b/authentik/stages/prompt/stage.py @@ -161,7 +161,7 @@ class PromptStageView(ChallengeStageView): response_class = PromptResponseChallenge def get_challenge(self, *args, **kwargs) -> Challenge: - fields = list(self.executor.current_stage.fields.all()) + fields = list(self.executor.current_stage.fields.all().order_by("order")) challenge = PromptChallenge( data={ "type": ChallengeTypes.native, @@ -185,5 +185,4 @@ class PromptStageView(ChallengeStageView): if PLAN_CONTEXT_PROMPT not in self.executor.plan.context: self.executor.plan.context[PLAN_CONTEXT_PROMPT] = {} self.executor.plan.context[PLAN_CONTEXT_PROMPT].update(response.validated_data) - print(self.executor.plan.context[PLAN_CONTEXT_PROMPT]) return self.executor.stage_ok()