diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-01 14:12:42 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-04-01 16:14:38 +0200 |
commit | ec3c66b986598def2df27941df38272fb72d4aca (patch) | |
tree | 035370bdc691986636b24916c7541a5475e6e4dc | |
parent | 6f45a89bab18ff5fcbec630d9cc3d81a7bef42a9 (diff) | |
download | gitlab-ce-ec3c66b986598def2df27941df38272fb72d4aca.tar.gz |
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: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | CHANGELOG | 9 | ||||
-rw-r--r-- | app/models/user.rb | 2 | ||||
-rw-r--r-- | spec/models/user_spec.rb | 7 |
3 files changed, 18 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG index 11cde92f6d2..e7a5fd639d7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,15 @@ v 8.6.3 (unreleased) - Fix commit comment alignment (Stan Hu). !3466 - 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 + - 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 issue with dropdowns not selecting values. !3478 diff --git a/app/models/user.rb b/app/models/user.rb index 9c315cfe966..3428bbb9756 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -408,6 +408,8 @@ class User < ActiveRecord::Base end 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) end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 0ab7fd88ce6..8b2fb77e28e 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -173,6 +173,13 @@ describe User, models: true do expect(user).to be_invalid 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 |