diff --git a/CHANGELOG.md b/CHANGELOG.md index 720d9c971..b80ad962f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog Fab Manager +- Fix a bug: error handling on password recovery +- Fix a bug: error handling on machine attachment upload + ## v2.8.1 2019 January 02 - Fix ES upgrade: when docker-compose file is using ${PWD}, the ES config volume is attached to the wrong container diff --git a/app/assets/javascripts/controllers/application.js.erb b/app/assets/javascripts/controllers/application.js.erb index c9c930ad3..0787067b6 100644 --- a/app/assets/javascripts/controllers/application.js.erb +++ b/app/assets/javascripts/controllers/application.js.erb @@ -142,7 +142,7 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco $scope.user.organization = orga; // display errors angular.forEach(error.data.errors, function (v, k) { - angular.forEach(function (v, err) { + angular.forEach(v, function (err) { $scope.alerts.push({ msg: k + ': ' + err, type: 'danger' @@ -175,9 +175,9 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco return $scope.changePassword = function () { $scope.alerts = []; - return $http.put('/users/password.json', { user: $scope.user }).success(function () { $uibModalInstance.close(); }).error(function (data) { - angular.forEach(data.errors, function (v, k) { - angular.forEach(function (v, err) { + return $http.put('/users/password.json', { user: $scope.user }).then(function () { $uibModalInstance.close(); }).catch(function (data) { + angular.forEach(data.data.errors, function (v, k) { + angular.forEach(v, function (err) { $scope.alerts.push({ msg: k + ': ' + err, type: 'danger' @@ -400,7 +400,7 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco $scope.user = { email: '' }; return $scope.sendReset = function () { $scope.alerts = []; - return $http.post('/users/password.json', { user: $scope.user }).success(function () { $uibModalInstance.close(); }).error(function () { + return $http.post('/users/password.json', { user: $scope.user }).then(function () { $uibModalInstance.close(); }).catch(function () { $scope.alerts.push({ msg: _t('your_email_address_is_unknown'), type: 'danger' diff --git a/app/assets/javascripts/controllers/machines.js.erb b/app/assets/javascripts/controllers/machines.js.erb index 72bc6e3ab..d673ce6a8 100644 --- a/app/assets/javascripts/controllers/machines.js.erb +++ b/app/assets/javascripts/controllers/machines.js.erb @@ -43,7 +43,7 @@ class MachinesController { if ((content.id == null)) { $scope.alerts = []; angular.forEach(content, function (v, k) { - angular.forEach(function (v, err) { + angular.forEach(v, function (err) { $scope.alerts.push({ msg: k + ': ' + err, type: 'danger'