flows: fix invalid graph generation

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-09-21 10:53:29 +02:00
parent b16a3d5697
commit 81e820b6e6
2 changed files with 3 additions and 3 deletions

View File

@ -185,7 +185,7 @@ class FlowDiagram:
flow_element = DiagramElement( flow_element = DiagramElement(
"flow_start", "flow_start",
_("Flow") + "\n" + self.flow.name, _("Flow") + "\n" + self.flow.name,
"", "" if len(flow_policies) > 0 else None,
source=flow_policies, source=flow_policies,
style=["[[", "]]"], style=["[[", "]]"],
) )

View File

@ -10,7 +10,7 @@ from authentik.policies.models import PolicyBinding
from authentik.stages.dummy.models import DummyStage from authentik.stages.dummy.models import DummyStage
DIAGRAM_EXPECTED = """graph TD DIAGRAM_EXPECTED = """graph TD
--> flow_start[["Flow flow_start[["Flow
test-default-context"]] test-default-context"]]
--> stage_0(["Stage (Dummy Stage) --> stage_0(["Stage (Dummy Stage)
dummy1"]) dummy1"])
@ -20,7 +20,7 @@ stage_0 --> stage_1_policy_0{{"Policy (Dummy Policy)
dummy2-policy"}} dummy2-policy"}}
stage_1 --> done[["End of the flow"]]""" stage_1 --> done[["End of the flow"]]"""
DIAGRAM_SHORT_EXPECTED = """graph TD DIAGRAM_SHORT_EXPECTED = """graph TD
--> flow_start[["Flow flow_start[["Flow
test-default-context"]] test-default-context"]]
flow_start --> done[["End of the flow"]]""" flow_start --> done[["End of the flow"]]"""