IFF v2 api disallow direct job launches

This commit is contained in:
Matthew Jones 2017-08-22 09:53:10 -04:00
parent f14a47caa0
commit f3f10df361
No known key found for this signature in database
GPG Key ID: 76A4C17A97590C1C

View File

@ -3739,6 +3739,13 @@ class JobList(ListCreateAPIView):
methods.remove('POST')
return methods
# NOTE: Remove in 3.3, switch ListCreateAPIView to ListAPIView
def post(self, request, *args, **kwargs):
if get_request_version(self.request) > 1:
return Response({"error": _("POST not allowed for Job launching in version 2 of the api")},
status=status.HTTP_405_METHOD_NOT_ALLOWED)
return super(JobList, self).post(request, *args, **kwargs)
class JobDetail(UnifiedJobDeletionMixin, RetrieveUpdateDestroyAPIView):