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
This commit is contained in:
Jared Tabor 2015-10-14 13:19:36 -07:00
parent 54f308a61b
commit b45534859f

View File

@ -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 {