diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-01-19 16:25:38 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-01-19 16:25:38 +0100 |
commit | 98e1a5b63424b6912de98ee5055d3f9e57e63899 (patch) | |
tree | 773952fd630e222ec72d368f53e4a238d3d6c839 /app/models/user.rb | |
parent | 425f8d6f572a3ae47c971a48bfefc9907c7bda55 (diff) | |
download | gitlab-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.rb | 5 |
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 |