Merge pull request #4192 from jangsutsr/4190_unified_job_field_name_modification

Update unified_job related field name
This commit is contained in:
Aaron Tan 2016-12-01 11:45:39 -05:00 committed by GitHub
commit 805d4d1ed6

View File

@ -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)