fix: update user profile completed rule

This commit is contained in:
2021-09-02 11:48:53 +08:00
parent c52458a7e3
commit a422aa638d
9 changed files with 29 additions and 2 deletions

View File

@@ -78,7 +78,6 @@ class UsersController < ApplicationController
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)
@user.profile_completed = true if @user.nickname.present? && @user.gender.present? && @user.mail.present? && @user.custom_department.present?
unless @user.save
render_error(@user.errors.full_messages.join(", "))
end