From 9b3e94c7c872dd2941ae986435417bd7d97bcc68 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 28 Feb 2021 10:28:37 +0100 Subject: [PATCH] flows: fix flow diagram showing policy after stage and not before --- authentik/flows/api/flows.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/authentik/flows/api/flows.py b/authentik/flows/api/flows.py index 5979ce12f..b5485ac8f 100644 --- a/authentik/flows/api/flows.py +++ b/authentik/flows/api/flows.py @@ -107,13 +107,6 @@ class FlowViewSet(ModelViewSet): .filter(target=flow) .order_by("order") ): - body.append( - DiagramElement( - f"stage_{s_index}", - "operation", - f"Stage\n{stage_binding.stage.name}", - ) - ) for p_index, policy_binding in enumerate( get_objects_for_user( request.user, "authentik_policies.view_policybinding" @@ -128,6 +121,13 @@ class FlowViewSet(ModelViewSet): f"Policy\n{policy_binding.policy.name}", ) ) + body.append( + DiagramElement( + f"stage_{s_index}", + "operation", + f"Stage\n{stage_binding.stage.name}", + ) + ) # If the 2nd last element is a policy, we need to have an item to point to # for a negative case body.append(