Set ignoreHttpError to false after testPassword

Moved ignoreHttpError to the controller and set it to false after
testPassword.

Tested: Changed the password.
Change-Id: If860c073bcedcfba6a0743ea656c76ff06fd7de0
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 7354385..fec8572 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -238,7 +238,6 @@
         testPassword: function(username, password) {
           // Calls /login without the current session to verify the given
           // password is correct ignore the interceptor logout on a bad password
-          DataService.ignoreHttpError = true;
           return $http({
                    method: 'POST',
                    url: DataService.getHost() + '/login',
diff --git a/app/users/controllers/user-accounts-controller.js b/app/users/controllers/user-accounts-controller.js
index 868407b..17dd0e9 100644
--- a/app/users/controllers/user-accounts-controller.js
+++ b/app/users/controllers/user-accounts-controller.js
@@ -36,6 +36,7 @@
         }
 
         // Verify the oldPassword is correct
+        dataService.ignoreHttpError = true;
         APIUtils.testPassword(user, oldPassword)
             .then(
                 function(state) {
@@ -56,6 +57,8 @@
                 function(error) {
                   $scope.state = 'error';
                   $scope.errorMsg = 'Old password is not correct!';
+                }).finally(function() {
+                  dataService.ignoreHttpError = false;
                 });
       };
     }