diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 68942486c..4d769260d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -79,10 +79,10 @@ def create # PUT /users/1 # PUT /users/1.xml def update + @user = LinkedData::Client::Models::User.find(params[:id]) + @user = LinkedData::Client::Models::User.find_by_username(params[:id]).first if @user.nil? @errors = validate_update(user_params) if @errors.size < 1 - @user = LinkedData::Client::Models::User.find(params[:id]) - @user = LinkedData::Client::Models::User.find_by_username(params[:id]).first if @user.nil? if params[:user][:password] error_response = @user.update(values: { password: params[:user][:password] })