mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Update unified_job related field name.
This commit is contained in:
parent
3d56c2b50f
commit
99029a1b0d
@ -1152,7 +1152,7 @@ class ProjectUpdateDetail(RetrieveDestroyAPIView):
|
||||
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
obj = self.get_object()
|
||||
if obj.unified_job_nodes.filter(workflow_job__status__in=ACTIVE_STATES).exists():
|
||||
if obj.unified_job_node.filter(workflow_job__status__in=ACTIVE_STATES).exists():
|
||||
raise PermissionDenied(detail=_('Cannot delete job resource when associated workflow job is running.'))
|
||||
return super(ProjectUpdateDetail, self).destroy(request, *args, **kwargs)
|
||||
|
||||
@ -2303,7 +2303,7 @@ class InventoryUpdateDetail(RetrieveDestroyAPIView):
|
||||
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
obj = self.get_object()
|
||||
if obj.unified_job_nodes.filter(workflow_job__status__in=ACTIVE_STATES).exists():
|
||||
if obj.unified_job_node.filter(workflow_job__status__in=ACTIVE_STATES).exists():
|
||||
raise PermissionDenied(detail=_('Cannot delete job resource when associated workflow job is running.'))
|
||||
return super(InventoryUpdateDetail, self).destroy(request, *args, **kwargs)
|
||||
|
||||
@ -3297,7 +3297,7 @@ class JobDetail(RetrieveUpdateDestroyAPIView):
|
||||
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
obj = self.get_object()
|
||||
if obj.unified_job_nodes.filter(workflow_job__status__in=ACTIVE_STATES).exists():
|
||||
if obj.unified_job_node.filter(workflow_job__status__in=ACTIVE_STATES).exists():
|
||||
raise PermissionDenied(detail=_('Cannot delete job resource when associated workflow job is running.'))
|
||||
return super(JobDetail, self).destroy(request, *args, **kwargs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user