diff --git a/awx/ui/client/src/notifications/add/add.controller.js b/awx/ui/client/src/notifications/add/add.controller.js index 1ebb74d96a..60eee42408 100644 --- a/awx/ui/client/src/notifications/add/add.controller.js +++ b/awx/ui/client/src/notifications/add/add.controller.js @@ -154,7 +154,7 @@ export default ['$rootScope', 'Rest', 'Wait', 'NotificationsFormObject', if (field.type === 'number') { $scope[i] = Number($scope[i]); } - if (field.name === "username" && $scope.notification_type.value === "email" && value === null) { + if (i === "username" && $scope.notification_type.value === "email" && value === null) { $scope[i] = ""; } if (field.type === 'sensitive' && value === null) { diff --git a/awx/ui/client/src/notifications/edit/edit.controller.js b/awx/ui/client/src/notifications/edit/edit.controller.js index 331e185347..24fc4b3a74 100644 --- a/awx/ui/client/src/notifications/edit/edit.controller.js +++ b/awx/ui/client/src/notifications/edit/edit.controller.js @@ -241,10 +241,10 @@ export default ['Rest', 'Wait', if (field.type === 'number') { $scope[i] = Number($scope[i]); } - if (field.name === "username" && $scope.notification_type.value === "email" && value === null) { + if (i === "username" && $scope.notification_type.value === "email" && (value === null || value === undefined)) { $scope[i] = ""; } - if (field.type === 'sensitive' && value === null) { + if (field.type === 'sensitive' && (value === null || value === undefined)) { $scope[i] = ""; } return $scope[i]; @@ -256,8 +256,8 @@ export default ['Rest', 'Wait', delete params.notification_configuration.email_options; - params.notification_configuration.use_ssl = $scope.use_ssl; - params.notification_configuration.use_tls = $scope.use_tls; + params.notification_configuration.use_ssl = Boolean($scope.use_ssl); + params.notification_configuration.use_tls = Boolean($scope.use_tls); Wait('start'); Rest.setUrl(url + id + '/');