FIX: proper redirection when deleting a user

This commit is contained in:
Régis Hanol 2014-12-25 18:25:07 +01:00
parent b65ac132b7
commit 8edf2afb83
1 changed files with 5 additions and 1 deletions

View File

@ -331,7 +331,11 @@ Discourse.AdminUser = Discourse.User.extend({
data: formData
}).then(function(data) {
if (data.deleted) {
if (/^\/admin\/users\/list\//.test(location)) {
document.location = location;
} else {
document.location = "/admin/users/list/active";
}
} else {
bootbox.alert(I18n.t("admin.user.delete_failed"));
if (data.user) {