FIX: add context for deactivated user logs
This commit is contained in:
parent
8cf0f51eb2
commit
3a6e137e70
|
@ -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) {
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue