mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 15:21:13 +03:00
Fix up some flake8 issues
This commit is contained in:
parent
00e55e3813
commit
c852503163
@ -2189,9 +2189,6 @@ class JobTemplateDetail(RetrieveUpdateDestroyAPIView):
|
||||
can_delete = request.user.can_access(JobTemplate, 'delete', obj)
|
||||
if not can_delete:
|
||||
raise PermissionDenied("Cannot delete job template.")
|
||||
if obj.jobs.filter(status__in=['new', 'pending', 'waiting', 'running']).exists():
|
||||
return Response({"error": "Delete not allowed while there are jobs running"},
|
||||
status=status.HTTP_405_METHOD_NOT_ALLOWED)
|
||||
return super(JobTemplateDetail, self).destroy(request, *args, **kwargs)
|
||||
|
||||
|
||||
|
@ -761,7 +761,7 @@ class ProjectAccess(BaseAccess):
|
||||
return self.user in obj.admin_role
|
||||
|
||||
def can_delete(self, obj):
|
||||
is_change_allowed = self.can_change(obj, None)
|
||||
is_change_allowed = self.can_change(obj, None)
|
||||
if not is_change_allowed:
|
||||
return False
|
||||
active_jobs = []
|
||||
|
Loading…
Reference in New Issue
Block a user