2424logger = logging .getLogger (__name__ )
2525
2626__all__ = (
27- "Workflow" ,
2827 "Task" ,
28+ "Workflow" ,
2929)
3030
3131
@@ -56,7 +56,8 @@ def __new__(mcs, name, bases, attrs):
5656
5757
5858class Workflow (models .Model , metaclass = WorkflowBase ):
59- """The `WorkflowState` object holds the state of a workflow instances.
59+ """
60+ The `WorkflowState` object holds the state of a workflow instances.
6061
6162 It is represented by a Django Model. This way all workflow states
6263 are persisted in your database.
@@ -118,7 +119,8 @@ def get_nodes(cls):
118119
119120 @classmethod
120121 def urls (cls ):
121- """Return all URLs to workflow related task and other special views.
122+ """
123+ Return all URLs to workflow related task and other special views.
122124
123125 Example::
124126
@@ -188,7 +190,8 @@ def get_override_url(self):
188190
189191 @classmethod
190192 def get_graph (cls , color = "black" ):
191- """Return workflow graph.
193+ """
194+ Return workflow graph.
192195
193196 Returns:
194197 (graphviz.Digraph): Directed graph of the workflow.
@@ -217,7 +220,8 @@ def get_graph(cls, color="black"):
217220
218221 @classmethod
219222 def get_graph_svg (cls ):
220- """Return graph representation of a model workflow as SVG.
223+ """
224+ Return graph representation of a model workflow as SVG.
221225
222226 The SVG is HTML safe and can be included in a template, e.g.:
223227
@@ -306,7 +310,8 @@ def get_instance_graph(self):
306310 return graph
307311
308312 def get_instance_graph_svg (self , output_format = "svg" ):
309- """Return graph representation of a running workflow as SVG.
313+ """
314+ Return graph representation of a running workflow as SVG.
310315
311316 The SVG is HTML safe and can be included in a template, e.g.:
312317
@@ -331,7 +336,8 @@ def get_instance_graph_svg(self, output_format="svg"):
331336 get_instance_graph_svg .short_description = t ("instance graph" )
332337
333338 def get_instance_graph_mermaid (self ):
334- """Return instance graph as Mermaid diagram syntax.
339+ """
340+ Return instance graph as Mermaid diagram syntax.
335341
336342 This can be used with MermaidJS for client-side rendering in admin.
337343
@@ -633,12 +639,12 @@ def save(self, **kwargs):
633639
634640 def get_absolute_url (self ):
635641 if self .completed :
636- return # completed tasks have no detail view
642+ return None # completed tasks have no detail view
637643 url_name = f"{ self .workflow .get_url_namespace ()} :{ self .name } "
638644 try :
639645 return reverse (url_name , kwargs = {"pk" : self .pk })
640646 except NoReverseMatch :
641- return # no URL was defined for this task
647+ return None # no URL was defined for this task
642648
643649 @property
644650 def node (self ):
@@ -672,7 +678,8 @@ def fail(self):
672678 self .save (update_fields = ["status" , "exception" , "stacktrace" ])
673679
674680 def enqueue (self , countdown = None , eta = None ):
675- """Schedule the task for execution.
681+ """
682+ Schedule the task for execution.
676683
677684 Args:
678685 countdown (int):
@@ -698,7 +705,8 @@ def enqueue(self, countdown=None, eta=None):
698705 )
699706
700707 def start_next_tasks (self , next_nodes : list = None ):
701- """Start new tasks following another tasks.
708+ """
709+ Start new tasks following another tasks.
702710
703711 Args:
704712 self (Task): The task that precedes the next tasks.
0 commit comments