summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-19 16:25:38 +0100
committerDouwe Maan <douwe@gitlab.com>2016-01-19 16:25:38 +0100
commit98e1a5b63424b6912de98ee5055d3f9e57e63899 (patch)
tree773952fd630e222ec72d368f53e4a238d3d6c839 /app/models/user.rb
parent425f8d6f572a3ae47c971a48bfefc9907c7bda55 (diff)
downloadgitlab-ce-98e1a5b63424b6912de98ee5055d3f9e57e63899.tar.gz
Allow LDAP users to change their email if it was not set by the LDAP server
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 592468933ed..4214f01f6a4 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -664,7 +664,10 @@ class User < ActiveRecord::Base
end
def all_emails
- [self.email, *self.emails.map(&:email)]
+ all_emails = []
+ all_emails << self.email unless self.temp_oauth_email?
+ all_emails.concat(self.emails.map(&:email))
+ all_emails
end
def hook_attrs