Commit 2e8b0fa5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Oauth users and users created by admin should be confirmed immediatly

parent 6fff92e9
......@@ -47,6 +47,7 @@ class Admin::UsersController < Admin::ApplicationController
@user = User.build_user(params[:user].merge(opts), as: :admin)
@user.admin = (admin && admin.to_i > 0)
@user.created_by_id = current_user.id
@user.confirm!
respond_to do |format|
if @user.save
......
......@@ -29,6 +29,7 @@ module Gitlab
user = model.build_user(opts, as: :admin)
user.save!
user.confirm!
log.info "(OAuth) Creating user #{email} from login with extern_uid => #{uid}"
if Gitlab.config.omniauth['block_auto_created_users'] && !ldap?
......
......@@ -23,6 +23,10 @@ FactoryGirl.define do
end
factory :admin, traits: [:admin]
after :create do |u|
u.confirm!
end
end
factory :project do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment