fix: profile completed
This commit is contained in:
parent
8c60ce1d76
commit
a2ae8f1630
|
@ -186,7 +186,7 @@ class User < Owner
|
|||
:show_email, :show_location, :show_department,
|
||||
:technical_title, :province, :city, :custom_department, to: :user_extension, allow_nil: true
|
||||
|
||||
before_save :update_hashed_password, :set_lastname, :set_profile_completed
|
||||
before_save :update_hashed_password, :set_lastname
|
||||
after_create do
|
||||
SyncTrustieJob.perform_later("user", 1) if allow_sync_to_trustie?
|
||||
end
|
||||
|
@ -757,6 +757,10 @@ class User < Owner
|
|||
laboratory_id.present? && laboratory_id != 1
|
||||
end
|
||||
|
||||
def profile_is_completed?
|
||||
self.nickname.present? && self.gender.present? && self.mail.present? && self.custom_department.present?
|
||||
end
|
||||
|
||||
protected
|
||||
def validate_password_length
|
||||
# 管理员的初始密码是5位
|
||||
|
@ -783,10 +787,6 @@ class User < Owner
|
|||
def set_lastname
|
||||
self.lastname = self.nickname if changes[:nickname].present?
|
||||
end
|
||||
|
||||
def set_profile_completed
|
||||
self.profile_completed = self.nickname.present? && self.gender.present? && self.mail.present? && self.custom_department.present?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ json.tidding_count 0
|
|||
json.user_phone_binded @user.phone.present?
|
||||
# json.phone @user.phone
|
||||
# json.email @user.mail
|
||||
json.profile_completed @user.profile_completed?
|
||||
json.profile_completed @user.profile_is_completed?
|
||||
json.professional_certification @user.professional_certification
|
||||
json.devops_step @user.devops_step
|
||||
json.ci_certification @user.ci_certification?
|
||||
|
|
Loading…
Reference in New Issue