FEATURE: Log username changes by staff

Also fix the tests for changing username
This commit is contained in:
riking
2015-01-16 14:30:46 -08:00
parent 18215f90d0
commit 1ab0d6bd82
6 changed files with 59 additions and 10 deletions

View File

@ -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: {