Commit 1b0198f1d3fc621b339af0e7fd79a74919856d46

Authored by Florian Unglaub
1 parent 6d6c7a17

save newly created users directly in the model

app/controllers/omniauth_callbacks_controller.rb
... ... @@ -39,7 +39,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
39 39 redirect_to profile_path
40 40 else
41 41 @user = User.find_or_new_for_omniauth(oauth)
42   - @user.save! if @user.try('new_record?')
43 42  
44 43 if @user
45 44 sign_in_and_redirect @user
... ...
app/models/user.rb
... ... @@ -114,6 +114,8 @@ class User < ActiveRecord::Base
114 114 )
115 115  
116 116 @user.blocked = true if Gitlab.config.omniauth.block_auto_created_users
  117 + @user.save!
  118 +
117 119 @user
118 120 end
119 121 end
... ...