From 91588bed8bbf5f20a8fcdb348a3317adec6c98bf Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 21 May 2015 15:02:52 -0400 Subject: [PATCH] FIX: some admin actions redirect to wrong path when deployed to subdirectory --- app/assets/javascripts/admin/models/admin-user.js.es6 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/admin/models/admin-user.js.es6 b/app/assets/javascripts/admin/models/admin-user.js.es6 index a841ed38a55..8416f535859 100644 --- a/app/assets/javascripts/admin/models/admin-user.js.es6 +++ b/app/assets/javascripts/admin/models/admin-user.js.es6 @@ -227,7 +227,7 @@ const AdminUser = Discourse.User.extend({ type: 'POST', data: { username_or_email: this.get('username') } }).then(function() { - document.location = "/"; + document.location = Discourse.getURL("/"); }).catch(function(e) { if (e.status === 404) { bootbox.alert(I18n.t('admin.impersonate.not_found')); @@ -305,9 +305,9 @@ const AdminUser = Discourse.User.extend({ }).then(function(data) { if (data.success) { if (data.username) { - document.location = "/admin/users/" + data.username; + document.location = Discourse.getURL("/admin/users/" + data.username); } else { - document.location = "/admin/users/list/active"; + document.location = Discourse.getURL("/admin/users/list/active"); } } else { bootbox.alert(I18n.t("admin.user.anonymize_failed")); @@ -370,7 +370,7 @@ const AdminUser = Discourse.User.extend({ if (/^\/admin\/users\/list\//.test(location)) { document.location = location; } else { - document.location = "/admin/users/list/active"; + document.location = Discourse.getURL("/admin/users/list/active"); } } else { bootbox.alert(I18n.t("admin.user.delete_failed"));