Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit 7285554

Browse files
Tijs-Bkmmbvnr
authored andcommitted
Convert label to str in graph_transitions.py
If the label of a state is not a string, trying to add it to the graphviz Graph will fail. This could be the case when using `FSMFieldMixin` instead of directly using `FSMField`.
1 parent 77a4d77 commit 7285554

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

django_fsm/management/commands/graph_transitions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ def generate_dot(fields_data):
105105

106106
final_states = targets - sources
107107
for name, label in final_states:
108-
subgraph.node(name, label=label, shape="doublecircle")
108+
subgraph.node(name, label=str(label), shape="doublecircle")
109109
for name, label in (sources | targets) - final_states:
110-
subgraph.node(name, label=label, shape="circle")
110+
subgraph.node(name, label=str(label), shape="circle")
111111
if field.default: # Adding initial state notation
112112
if label == field.default:
113113
initial_name = node_name(field, "_initial")

0 commit comments

Comments
 (0)