send empty string for email username/password if no user input

This commit is contained in:
jaredevantabor 2017-01-17 10:44:00 -08:00
parent 2217594f27
commit 176a3cc399
2 changed files with 5 additions and 5 deletions

View File

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

View File

@ -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 + '/');