From b45534859fd5ed1dedd4a332c17ae2f1f1ed3bff Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 14 Oct 2015 13:19:36 -0700 Subject: [PATCH] fixing custom inventory script error the source_script ID wasn't getting translated to inventory script ID on sources_scope when editing a preexisting source --- awx/ui/client/src/helpers/Groups.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/helpers/Groups.js b/awx/ui/client/src/helpers/Groups.js index 68d2cf5652..a15fc5f03e 100644 --- a/awx/ui/client/src/helpers/Groups.js +++ b/awx/ui/client/src/helpers/Groups.js @@ -1034,6 +1034,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name else if(fld === "inventory_script"){ // the API stores it as 'source_script', we call it inventory_script data.summary_fields['inventory_script'] = data.summary_fields.source_script; + sources_scope.inventory_script = data.source_script; + master.inventory_script = sources_scope.inventory_script; } else if (data[fld] !== undefined) { @@ -1396,7 +1398,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name if (mode === 'edit' || (mode === 'add' && group_created)) { Rest.put(data) .success(function () { - if (properties_scope.variables) { + if (properties_scope.variables && properties_scope.variables !== "---") { modal_scope.$emit('updateVariables', json_data, properties_scope.variable_url); } else {