Commit ec3c66b9 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'error-when-ldap-doesn-t-supply-an-email-address-14559' into 'master'

Allow temp-oauth-email as notification email

Closes #14559

/cc @dblessing @rymai

See merge request !3477
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 6f45a89b
...@@ -9,6 +9,15 @@ v 8.6.3 (unreleased) ...@@ -9,6 +9,15 @@ v 8.6.3 (unreleased)
- Fix commit comment alignment (Stan Hu). !3466 - Fix commit comment alignment (Stan Hu). !3466
- Update gitlab-shell version and doc to 2.6.12. gitlab-org/gitlab-ee!280 - Update gitlab-shell version and doc to 2.6.12. gitlab-org/gitlab-ee!280
- Mentions on confidential issues doesn't create todos for non-members. !3374 - Mentions on confidential issues doesn't create todos for non-members. !3374
- Allow temporary email as notification email. !3477
v 8.6.3
- Fix copying uploads when moving issue to another project
v 8.6.3 (unreleased)
- Mentions on confidential issues doesn't create todos for non-members
v 8.6.3 (unreleased)
- Fix Error 500 when searching for a comment in a project snippet. !3468 - Fix Error 500 when searching for a comment in a project snippet. !3468
- Fix issue with dropdowns not selecting values. !3478 - Fix issue with dropdowns not selecting values. !3478
......
...@@ -408,6 +408,8 @@ class User < ActiveRecord::Base ...@@ -408,6 +408,8 @@ class User < ActiveRecord::Base
end end
def owns_notification_email def owns_notification_email
return if self.temp_oauth_email?
self.errors.add(:notification_email, "is not an email you own") unless self.all_emails.include?(self.notification_email) self.errors.add(:notification_email, "is not an email you own") unless self.all_emails.include?(self.notification_email)
end end
......
...@@ -173,6 +173,13 @@ describe User, models: true do ...@@ -173,6 +173,13 @@ describe User, models: true do
expect(user).to be_invalid expect(user).to be_invalid
end end
end end
context 'owns_notification_email' do
it 'accepts temp_oauth_email emails' do
user = build(:user, email: "temp-email-for-oauth@example.com")
expect(user).to be_valid
end
end
end end
end end
......
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