Merge pull request #1269 from AlanCoding/no_more_jobs

Deprecate jobs creation via sublist
This commit is contained in:
Alan Rominger 2018-04-06 14:08:10 -04:00 committed by GitHub
commit 5df957e223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3476,6 +3476,13 @@ class JobTemplateJobsList(SubListCreateAPIView):
relationship = 'jobs'
parent_key = 'job_template'
@property
def allowed_methods(self):
methods = super(JobTemplateJobsList, self).allowed_methods
if get_request_version(getattr(self, 'request', None)) > 1:
methods.remove('POST')
return methods
class JobTemplateInstanceGroupsList(SubListAttachDetachAPIView):