mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FEATURE: Log username changes by staff
Also fix the tests for changing username
This commit is contained in:
@ -88,7 +88,8 @@ class UsersController < ApplicationController
|
||||
user = fetch_user_from_params
|
||||
guardian.ensure_can_edit_username!(user)
|
||||
|
||||
result = user.change_username(params[:new_username])
|
||||
# TODO proper error surfacing (result is a Model#save call)
|
||||
result = user.change_username(params[:new_username], current_user)
|
||||
raise Discourse::InvalidParameters.new(:new_username) unless result
|
||||
|
||||
render json: {
|
||||
|
Reference in New Issue
Block a user