From 81e820b6e60389b99b1576217e6b0d38c2298b68 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 21 Sep 2022 10:53:29 +0200 Subject: [PATCH] flows: fix invalid graph generation Signed-off-by: Jens Langhammer --- authentik/flows/api/flows_diagram.py | 2 +- authentik/flows/tests/test_api.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/authentik/flows/api/flows_diagram.py b/authentik/flows/api/flows_diagram.py index 1ce68439b..5ac3f7b07 100644 --- a/authentik/flows/api/flows_diagram.py +++ b/authentik/flows/api/flows_diagram.py @@ -185,7 +185,7 @@ class FlowDiagram: flow_element = DiagramElement( "flow_start", _("Flow") + "\n" + self.flow.name, - "", + "" if len(flow_policies) > 0 else None, source=flow_policies, style=["[[", "]]"], ) diff --git a/authentik/flows/tests/test_api.py b/authentik/flows/tests/test_api.py index 0bca3c8e3..3de7dd3f0 100644 --- a/authentik/flows/tests/test_api.py +++ b/authentik/flows/tests/test_api.py @@ -10,7 +10,7 @@ from authentik.policies.models import PolicyBinding from authentik.stages.dummy.models import DummyStage DIAGRAM_EXPECTED = """graph TD ---> flow_start[["Flow +flow_start[["Flow test-default-context"]] --> stage_0(["Stage (Dummy Stage) dummy1"]) @@ -20,7 +20,7 @@ stage_0 --> stage_1_policy_0{{"Policy (Dummy Policy) dummy2-policy"}} stage_1 --> done[["End of the flow"]]""" DIAGRAM_SHORT_EXPECTED = """graph TD ---> flow_start[["Flow +flow_start[["Flow test-default-context"]] flow_start --> done[["End of the flow"]]"""