Browse Source

fix

tags/v3.1.0^2^2^2
vilet.yy 5 years ago
parent
commit
e8f4b3f17c
1 changed files with 0 additions and 8 deletions
  1. +0
    -8
      app/controllers/users_controller.rb

+ 0
- 8
app/controllers/users_controller.rb View File

@@ -74,18 +74,10 @@ class UsersController < ApplicationController
def update
return render_not_found unless @user = User.find_by_id(params[:id]) || User.find_by(login: params[:id])
<<<<<<< HEAD
Util.write_file(@image, avatar_path(@user)) if user_params[:image].present?
@user.attributes = user_params.except(:image)
if @user.save
render_ok
else
=======
return render_forbidden unless User.current.logged? && (current_user&.admin? || current_user.id == @user.id)
Util.write_file(@image, avatar_path(@user)) if user_params[:image].present?
@user.attributes = user_params.except(:image)
unless @user.save
>>>>>>> ed8d646d479bdcd84784909a024949bb8e4f093f
render_error(@user.errors.full_messages.join(", "))
end
end


Loading…
Cancel
Save