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_start",
_("Flow") + "\n" + self.flow.name,
"",
"" if len(flow_policies) > 0 else None,
source=flow_policies,
style=["[[", "]]"],
)

View file

@ -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"]]"""