Fix error display on the convert user widget

This commit is contained in:
Joseph Schorr 2015-05-07 16:28:58 -04:00
parent b50600cde8
commit 7ea02c186a

View file

@ -39,6 +39,10 @@ angular.module('quay').directive('convertUserToOrg', function () {
$scope.loading = true;
var errorHandler = ApiService.errorDisplay(function() {
$scope.loading = false;
});
var data = {
'adminUser': $scope.org.adminUser,
'adminPassword': $scope.org.adminPassword,
@ -49,14 +53,7 @@ angular.module('quay').directive('convertUserToOrg', function () {
CookieService.putPermanent('quay.namespace', $scope.user.username);
UserService.load();
$location.path('/');
}, function(resp) {
$scope.loading = false;
if (resp.data.reason == 'invaliduser') {
$('#invalidadminModal').modal({});
} else {
$('#cannotconvertModal').modal({});
}
});
}, errorHandler);
};
}
};