Merge pull request #1175 from AlanCoding/protect_hosts

Add deletion protection to hosts
This commit is contained in:
Alan Rominger
2018-04-18 10:06:05 -04:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -2177,7 +2177,7 @@ class HostList(HostRelatedSearchMixin, ListCreateAPIView):
return Response(dict(error=_(six.text_type(e))), status=status.HTTP_400_BAD_REQUEST)
class HostDetail(ControlledByScmMixin, RetrieveUpdateDestroyAPIView):
class HostDetail(RelatedJobsPreventDeleteMixin, ControlledByScmMixin, RetrieveUpdateDestroyAPIView):
always_allow_superuser = False
model = Host