Implement recursive spawned job cancel.

This commit is contained in:
Aaron Tan
2016-11-02 15:23:13 -04:00
parent 1a960229d7
commit 3778914aa9
4 changed files with 38 additions and 1 deletions

View File

@@ -2869,6 +2869,14 @@ class WorkflowJobCancel(RetrieveAPIView):
is_job_cancel = True
new_in_310 = True
def post(self, request, *args, **kwargs):
obj = self.get_object()
if obj.can_cancel:
obj.cancel()
return Response(status=status.HTTP_202_ACCEPTED)
else:
return self.http_method_not_allowed(request, *args, **kwargs)
class SystemJobTemplateList(ListAPIView):
model = SystemJobTemplate