From fc583ead21b2d6598ca61402c40b604926985cd2 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Thu, 23 Feb 2017 10:51:54 -0500 Subject: [PATCH] allow AD_HOC_COMMANDS to be set to [] in the settings ui see: #4975 --- awx/main/conf.py | 1 + .../client/src/configuration/configuration.controller.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/awx/main/conf.py b/awx/main/conf.py index 8a2b361ab6..bbdf159ae6 100644 --- a/awx/main/conf.py +++ b/awx/main/conf.py @@ -111,6 +111,7 @@ register( help_text=_('List of modules allowed to be used by ad-hoc jobs.'), category=_('Jobs'), category_slug='jobs', + required=False, ) register( diff --git a/awx/ui/client/src/configuration/configuration.controller.js b/awx/ui/client/src/configuration/configuration.controller.js index 49a5f2ad99..05b5c2e576 100644 --- a/awx/ui/client/src/configuration/configuration.controller.js +++ b/awx/ui/client/src/configuration/configuration.controller.js @@ -364,7 +364,12 @@ export default [ payload[key] = _.map($scope[key], 'value').join(','); } } else { - payload[key] = $scope[key].value; + if(multiselectDropdowns.indexOf(key) !== -1) { + // Default AD_HOC_COMMANDS to an empty list + payload[key] = $scope[key].value || []; + } else { + payload[key] = $scope[key].value; + } } } else if($scope.configDataResolve[key].type === 'list' && $scope[key] !== null) { // Parse lists