mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 06:58:06 -03:30
Merge pull request #318 from ansible/405_v2_job_launch
Prevent v2 direct job launches
This commit is contained in:
commit
031b5f3269
@ -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