From 99029a1b0d0b3657008dbda277b87182c59b069c Mon Sep 17 00:00:00 2001 From: Aaron Tan Date: Thu, 1 Dec 2016 11:17:57 -0500 Subject: [PATCH] Update unified_job related field name. --- awx/api/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/awx/api/views.py b/awx/api/views.py index bea9711da9..de88b44518 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -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)