fix a bug that prevented JT admins from editing custom virtualenvs

see: https://github.com/ansible/tower/issues/1754
This commit is contained in:
Ryan Petrello
2018-05-14 13:14:33 -04:00
parent 0f98ed5046
commit 5b55e3cb2b
3 changed files with 22 additions and 5 deletions

View File

@@ -404,9 +404,11 @@ class ApiV1ConfigView(APIView):
data.update(dict(
project_base_dir = settings.PROJECTS_ROOT,
project_local_paths = Project.get_local_path_choices(),
custom_virtualenvs = get_custom_venv_choices(),
))
if JobTemplate.accessible_objects(request.user, 'admin_role').exists():
data['custom_virtualenvs'] = get_custom_venv_choices()
return Response(data)
def post(self, request):