Commit e6f58cb87da914f2a424df66b680e19e49dcd2e6
1 parent
5436d6af
Exists in
spb-stable
and in
3 other branches
Avoid false validation when create user
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
2 additions
and
3 deletions
Show diff stats
app/models/user.rb
lib/gitlab/oauth/user.rb
| ... | ... | @@ -34,14 +34,13 @@ module Gitlab |
| 34 | 34 | # In this case we generate temporary email and force user to fill it later |
| 35 | 35 | if user.email.blank? |
| 36 | 36 | user.generate_tmp_oauth_email |
| 37 | - user.save!(validate: false) | |
| 38 | 37 | else |
| 39 | 38 | # Google oauth returns email but dont return nickname |
| 40 | 39 | # So we use part of email as username for new user |
| 41 | 40 | user.username = email.match(/^[^@]*/)[0] |
| 42 | - user.save | |
| 43 | 41 | end |
| 44 | 42 | |
| 43 | + user.save! | |
| 45 | 44 | log.info "(OAuth) Creating user #{email} from login with extern_uid => #{uid}" |
| 46 | 45 | |
| 47 | 46 | if Gitlab.config.omniauth['block_auto_created_users'] && !ldap? | ... | ... |