mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: Don't allow username update via update route
It's not using the UsernameChanger
This commit is contained in:
@ -107,6 +107,9 @@ class UsersController < ApplicationController
|
|||||||
guardian.ensure_can_edit!(user)
|
guardian.ensure_can_edit!(user)
|
||||||
attributes = user_params.merge!(custom_fields: params[:custom_fields])
|
attributes = user_params.merge!(custom_fields: params[:custom_fields])
|
||||||
|
|
||||||
|
# We can't update the username via this route. Use the username route
|
||||||
|
attributes.delete(:username)
|
||||||
|
|
||||||
if params[:user_fields].present?
|
if params[:user_fields].present?
|
||||||
attributes[:custom_fields] = {} unless params[:custom_fields].present?
|
attributes[:custom_fields] = {} unless params[:custom_fields].present?
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user