diff --git a/static/js/controllers.js b/static/js/controllers.js index c7403a7cd..146c93b69 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -625,6 +625,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use UserService.updateUserIn($scope, function(user) { $scope.askForPassword = user.askForPassword; + $scope.cuser = jQuery.extend({}, user); }); $scope.readyForPlan = function() { @@ -701,13 +702,13 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use $scope.updatingUser = true; $scope.changePasswordSuccess = false; - ApiService.changeUserDetails($scope.user).then(function() { + ApiService.changeUserDetails($scope.cuser).then(function() { $scope.updatingUser = false; $scope.changePasswordSuccess = true; // Reset the form - $scope.user.password = ''; - $scope.user.repeatPassword = ''; + $scope.cuser.password = ''; + $scope.cuser.repeatPassword = ''; $scope.changePasswordForm.$setPristine(); // Reload the user. diff --git a/static/partials/user-admin.html b/static/partials/user-admin.html index 1b05ac382..1e5f0ab82 100644 --- a/static/partials/user-admin.html +++ b/static/partials/user-admin.html @@ -60,9 +60,9 @@