From b54c87c6d2ee5d2d5974d75b5c08cff511ff5597 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Fri, 5 Jun 2015 17:11:04 -0400 Subject: [PATCH 1/2] allow config endpoint to posted to without license data --- awx/api/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/api/views.py b/awx/api/views.py index d3d6e7f3cf..19142326d0 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -238,7 +238,8 @@ class ApiV1ConfigView(APIView): # Sanity check: If this license includes system tracking, make # sure that we have a valid MongoDB to point to, and complain if # we do not. - if (license_data['features']['system_tracking'] and settings.MONGO_HOST == NotImplemented): + if ('features' in license_data and 'system_tracking' in license_data['features'] and + license_data['features']['system_tracking'] and settings.MONGO_HOST == NotImplemented): return Response({ 'error': 'This license supports system tracking, which ' 'requires MongoDB to be installed. Since you are ' From a9642403c6b5fe8480f4293b36bb1dc43b82c09e Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Mon, 8 Jun 2015 09:39:00 -0400 Subject: [PATCH 2/2] flake8 --- awx/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/api/views.py b/awx/api/views.py index 19142326d0..10909f0a83 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -239,7 +239,7 @@ class ApiV1ConfigView(APIView): # sure that we have a valid MongoDB to point to, and complain if # we do not. if ('features' in license_data and 'system_tracking' in license_data['features'] and - license_data['features']['system_tracking'] and settings.MONGO_HOST == NotImplemented): + license_data['features']['system_tracking'] and settings.MONGO_HOST == NotImplemented): return Response({ 'error': 'This license supports system tracking, which ' 'requires MongoDB to be installed. Since you are '