save newly created users directly in the model

This commit is contained in:
Florian Unglaub 2012-08-31 16:24:12 +02:00
parent 6d6c7a17ea
commit 1b0198f1d3
2 changed files with 2 additions and 1 deletions

View file

@ -39,7 +39,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
redirect_to profile_path redirect_to profile_path
else else
@user = User.find_or_new_for_omniauth(oauth) @user = User.find_or_new_for_omniauth(oauth)
@user.save! if @user.try('new_record?')
if @user if @user
sign_in_and_redirect @user sign_in_and_redirect @user

View file

@ -114,6 +114,8 @@ class User < ActiveRecord::Base
) )
@user.blocked = true if Gitlab.config.omniauth.block_auto_created_users @user.blocked = true if Gitlab.config.omniauth.block_auto_created_users
@user.save!
@user @user
end end
end end