Skip to content

Commit 7f8855a

Browse files
committed
Fix dostring format
1 parent a6f456d commit 7f8855a

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

joeflow/views.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,19 @@ def get_template_names(self):
3131

3232
class StartWorkflowMixin:
3333
"""
34-
Use this mixin to create a start workflow with a view. Example:
34+
View-mixin to create a start workflow.
3535
36-
class MyStartWorkflowView(StartWorkflowMixin, TaskViewMixin, View):
37-
def post(self, request, *args, **kwargs):
38-
try:
39-
data = json.loads(request.body)
40-
workflow_id = self.start_workflow(data)
41-
except Exception as e:
42-
return HttpResponseBadRequest("Failed to start workflow")
36+
Example:
4337
44-
return JsonResponse({'message': 'Workflow started successfully.', 'id': workflow_id}, status=201)
38+
class MyStartWorkflowView(StartWorkflowMixin, TaskViewMixin, View):
39+
def post(self, request, *args, **kwargs):
40+
try:
41+
data = json.loads(request.body)
42+
workflow_id = self.start_workflow(data)
43+
except Exception as e:
44+
return HttpResponseBadRequest("Failed to start workflow")
45+
46+
return JsonResponse({'message': 'Workflow started successfully.', 'id': workflow_id}, status=201)
4547
"""
4648

4749

0 commit comments

Comments
 (0)