mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-27 10:21:49 -05:00
Fix bug by using cancel_flag.
This commit is contained in:
@@ -72,6 +72,7 @@ from awx.api.serializers import * # noqa
|
||||
from awx.api.metadata import RoleMetadata
|
||||
from awx.main.consumers import emit_channel_notification
|
||||
from awx.main.models.unified_jobs import ACTIVE_STATES
|
||||
#from awx.main.scheduler.tasks import run_job_complete
|
||||
|
||||
logger = logging.getLogger('awx.api.views')
|
||||
|
||||
@@ -2873,6 +2874,8 @@ class WorkflowJobCancel(RetrieveAPIView):
|
||||
obj = self.get_object()
|
||||
if obj.can_cancel:
|
||||
obj.cancel()
|
||||
#TODO: Figure out whether an immediate schedule is needed.
|
||||
#run_job_complete.delay(obj.id)
|
||||
return Response(status=status.HTTP_202_ACCEPTED)
|
||||
else:
|
||||
return self.http_method_not_allowed(request, *args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user