mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 21:21:21 -03:30
IFF v2 api disallow direct job launches
This commit is contained in:
parent
f14a47caa0
commit
f3f10df361
@ -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):
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user