| @@ -247,11 +247,11 @@ class ApplicationController < ActionController::Base | |||||
| end | end | ||||
| def require_profile_completed | def require_profile_completed | ||||
| tip_exception(411, "请完善资料后再操作") unless User.current.profile_completed | |||||
| tip_exception(411, "请完善资料后再操作") unless User.current.profile_is_completed? | |||||
| end | end | ||||
| def require_user_profile_completed(user) | def require_user_profile_completed(user) | ||||
| tip_exception(412, "请用户完善资料后再操作") unless user.profile_completed | |||||
| tip_exception(412, "请用户完善资料后再操作") unless user.profile_is_completed? | |||||
| end | end | ||||
| # 异常提醒 | # 异常提醒 | ||||
| @@ -280,7 +280,7 @@ class ApplicationController < ActionController::Base | |||||
| # 资料是否完善 | # 资料是否完善 | ||||
| def check_account | def check_account | ||||
| if !current_user.profile_completed? | |||||
| if !current_user. profile_is_completed? | |||||
| #info_url = '/account/profile' | #info_url = '/account/profile' | ||||
| tip_exception(402, nil) | tip_exception(402, nil) | ||||
| end | end | ||||
| @@ -18,7 +18,7 @@ class Admins::DeleteUnitApplyService < ApplicationService | |||||
| use_extensions = UserExtension&.where(school_id: @unit_apply.school_id) | use_extensions = UserExtension&.where(school_id: @unit_apply.school_id) | ||||
| user_ids = UserExtension&.where(school_id: @unit_apply.school_id)&.pluck(:user_id) | user_ids = UserExtension&.where(school_id: @unit_apply.school_id)&.pluck(:user_id) | ||||
| User.where(id: user_ids).update_all(profile_completed: false) | |||||
| User.where(id: user_ids) | |||||
| use_extensions.update_all(school_id: nil,department_id: nil) | use_extensions.update_all(school_id: nil,department_id: nil) | ||||
| @unit_apply&.user&.user_extension&.update_attribute("department_id", nil) | @unit_apply&.user&.user_extension&.update_attribute("department_id", nil) | ||||
| @@ -57,7 +57,7 @@ class Admins::ImportUserService < ApplicationService | |||||
| password: '12345678', | password: '12345678', | ||||
| phone: data.phone, | phone: data.phone, | ||||
| mail: "#{prefix}#{data.student_id}@qq.com", | mail: "#{prefix}#{data.student_id}@qq.com", | ||||
| profile_completed: true | |||||
| # profile_completed: true | |||||
| } | } | ||||
| ActiveRecord::Base.transaction do | ActiveRecord::Base.transaction do | ||||
| user = User.create!(attr) | user = User.create!(attr) | ||||
| @@ -24,7 +24,7 @@ class Projects::ApplyTransferService < ApplicationService | |||||
| raise Error, '仓库标识不正确' if @project.identifier != params[:identifier] | raise Error, '仓库标识不正确' if @project.identifier != params[:identifier] | ||||
| raise Error, '该仓库正在迁移' if @project.is_transfering | raise Error, '该仓库正在迁移' if @project.is_transfering | ||||
| raise Error, '新拥有者不存在' unless @owner.present? | raise Error, '新拥有者不存在' unless @owner.present? | ||||
| raise Error, '新拥有者资料不完善' if @owner.is_a?(User) && !@owner.profile_completed | |||||
| raise Error, '新拥有者资料不完善' if @owner.is_a?(User) && !@owner.profile_is_completed? | |||||
| raise Error, '新拥有者已经存在同名仓库!' if Project.where(user_id: @owner.id, identifier: params[:identifier]).present? | raise Error, '新拥有者已经存在同名仓库!' if Project.where(user_id: @owner.id, identifier: params[:identifier]).present? | ||||
| raise Error, '未拥有转移权限' unless is_permit_owner | raise Error, '未拥有转移权限' unless is_permit_owner | ||||
| end | end | ||||
| @@ -7,7 +7,7 @@ class Users::ApplyAuthenticationService < ApplicationService | |||||
| end | end | ||||
| def call | def call | ||||
| raise Error, '请先完善基本信息' unless user.profile_completed? | |||||
| raise Error, '请先完善基本信息' unless user.profile_is_completed? | |||||
| Users::ApplyAuthenticationForm.new(params).validate! | Users::ApplyAuthenticationForm.new(params).validate! | ||||
| # raise Error, '您已经申请过实名认证了' if ApplyUserAuthentication.real_name_auth.processing.exists?(user_id: user.id) | # raise Error, '您已经申请过实名认证了' if ApplyUserAuthentication.real_name_auth.processing.exists?(user_id: user.id) | ||||
| @@ -9,7 +9,7 @@ class Users::ApplyProfessionalAuthService < ApplicationService | |||||
| end | end | ||||
| def call | def call | ||||
| raise Error, '请先完善基本信息' unless user.profile_completed? | |||||
| raise Error, '请先完善基本信息' unless user.profile_is_completed? | |||||
| Users::ApplyProfessionalAuthForm.new(params).validate! | Users::ApplyProfessionalAuthForm.new(params).validate! | ||||
| # raise Error, '您已经申请过职业认证了' if ApplyUserAuthentication.professional_auth.processing.exists?(user_id: user.id) | # raise Error, '您已经申请过职业认证了' if ApplyUserAuthentication.professional_auth.processing.exists?(user_id: user.id) | ||||
| @@ -43,7 +43,7 @@ class Users::UpdateAccountService < ApplicationService | |||||
| end | end | ||||
| # 表示资料完整 | # 表示资料完整 | ||||
| user.profile_completed = true | |||||
| # user.profile_completed = true | |||||
| extension.save! | extension.save! | ||||
| user.save! | user.save! | ||||