change 404 errors to PermissionDenied for those with links

This commit is contained in:
AlanCoding 2016-05-04 14:56:06 -04:00
parent 0e7767c6a6
commit 18f48875c7

View File

@ -2482,7 +2482,7 @@ class SystemJobTemplateList(ListAPIView):
def get(self, request, *args, **kwargs):
if not request.user.is_superuser:
return Response(status=status.HTTP_404_NOT_FOUND)
raise PermissionDenied("Superuser privileges needed")
return super(SystemJobTemplateList, self).get(request, *args, **kwargs)
class SystemJobTemplateDetail(RetrieveAPIView):
@ -3212,7 +3212,7 @@ class SystemJobList(ListCreateAPIView):
def get(self, request, *args, **kwargs):
if not request.user.is_superuser:
return Response(status=status.HTTP_404_NOT_FOUND)
raise PermissionDenied("Superuser privileges needed")
return super(SystemJobList, self).get(request, *args, **kwargs)