copy/edit display test refactor, copy prefetch added

This commit is contained in:
AlanCoding
2016-09-09 15:13:48 -04:00
parent 507ba6a778
commit d77dc271d8
3 changed files with 192 additions and 147 deletions

View File

@@ -2205,7 +2205,10 @@ class JobTemplateList(ListCreateAPIView):
model = JobTemplate
serializer_class = JobTemplateSerializer
always_allow_superuser = False
capabilities_prefetch = ['admin', 'execute']
capabilities_prefetch = [
'admin', 'execute',
{'copy': ['project.use', 'inventory.use', 'credential.use', 'cloud_credential.use', 'network_credential.use']}
]
def post(self, request, *args, **kwargs):
ret = super(JobTemplateList, self).post(request, *args, **kwargs)