Commit 7e396245 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'djensen-remove-conditional-validations-on-user-secondary-emails' into 'master'

Remove conditions on 2 User email validations

See merge request gitlab-org/gitlab!70549
parents 54920263 8d214f06
...@@ -229,9 +229,9 @@ class User < ApplicationRecord ...@@ -229,9 +229,9 @@ class User < ApplicationRecord
validates :first_name, length: { maximum: 127 } validates :first_name, length: { maximum: 127 }
validates :last_name, length: { maximum: 127 } validates :last_name, length: { maximum: 127 }
validates :email, confirmation: true validates :email, confirmation: true
validates :notification_email, devise_email: true, allow_blank: true, if: ->(user) { user.notification_email != user.email } validates :notification_email, devise_email: true, allow_blank: true
validates :public_email, uniqueness: true, devise_email: true, allow_blank: true validates :public_email, uniqueness: true, devise_email: true, allow_blank: true
validates :commit_email, devise_email: true, allow_blank: true, if: ->(user) { user.commit_email != user.email && user.commit_email != Gitlab::PrivateCommitEmail::TOKEN } validates :commit_email, devise_email: true, allow_blank: true, unless: ->(user) { user.commit_email == Gitlab::PrivateCommitEmail::TOKEN }
validates :projects_limit, validates :projects_limit,
presence: true, presence: true,
numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: Gitlab::Database::MAX_INT_VALUE } numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: Gitlab::Database::MAX_INT_VALUE }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment