FIX: add context for deactivated user logs

This commit is contained in:
Arpit Jalan 2018-05-08 08:14:49 +05:30
parent 8cf0f51eb2
commit 3a6e137e70
2 changed files with 3 additions and 2 deletions

View File

@ -300,7 +300,8 @@ const AdminUser = Discourse.User.extend({
deactivate() { deactivate() {
return ajax('/admin/users/' + this.id + '/deactivate', { return ajax('/admin/users/' + this.id + '/deactivate', {
type: 'PUT' type: 'PUT',
data: { context: document.location.pathname }
}).then(function() { }).then(function() {
window.location.reload(); window.location.reload();
}).catch(function(e) { }).catch(function(e) {

View File

@ -276,7 +276,7 @@ class Admin::UsersController < Admin::AdminController
def deactivate def deactivate
guardian.ensure_can_deactivate!(@user) guardian.ensure_can_deactivate!(@user)
@user.deactivate @user.deactivate
StaffActionLogger.new(current_user).log_user_deactivate(@user, I18n.t('user.deactivated_by_staff')) StaffActionLogger.new(current_user).log_user_deactivate(@user, I18n.t('user.deactivated_by_staff'), params.slice(:context))
refresh_browser @user refresh_browser @user
render body: nil render body: nil
end end