From 3a6e137e70c0d57e977679b8a39494c17b1c469e Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Tue, 8 May 2018 08:14:49 +0530 Subject: [PATCH] FIX: add context for deactivated user logs --- app/assets/javascripts/admin/models/admin-user.js.es6 | 3 ++- app/controllers/admin/users_controller.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/models/admin-user.js.es6 b/app/assets/javascripts/admin/models/admin-user.js.es6 index 6cd414e9767..b8264264730 100644 --- a/app/assets/javascripts/admin/models/admin-user.js.es6 +++ b/app/assets/javascripts/admin/models/admin-user.js.es6 @@ -300,7 +300,8 @@ const AdminUser = Discourse.User.extend({ deactivate() { return ajax('/admin/users/' + this.id + '/deactivate', { - type: 'PUT' + type: 'PUT', + data: { context: document.location.pathname } }).then(function() { window.location.reload(); }).catch(function(e) { diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index d0053c5aaa2..10922e3c909 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -276,7 +276,7 @@ class Admin::UsersController < Admin::AdminController def deactivate guardian.ensure_can_deactivate!(@user) @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 render body: nil end