Commit fd31d6a3 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'dm-fix-ghost-user-validation' into 'master'

Skip validation when creating internal (ghost, service desk) users

See merge request !10949
parents c4209bcc b9e573db
......@@ -1068,11 +1068,13 @@ class User < ActiveRecord::Base
User.find_by_email(s)
end
scope.create(
user = scope.build(
username: username,
email: email,
&creation_block
)
user.save(validate: false)
user
ensure
Gitlab::ExclusiveLease.cancel(lease_key, uuid)
end
......
---
title: Skip validation when creating internal (ghost, service desk) users
merge_request:
author:
......@@ -1556,6 +1556,16 @@ describe User, models: true do
expect(ghost.email).to eq('ghost1@example.com')
end
end
context 'when a domain whitelist is in place' do
before do
stub_application_setting(domain_whitelist: ['gitlab.com'])
end
it 'creates a ghost user' do
expect(User.ghost).to be_persisted
end
end
end
describe '#update_two_factor_requirement' 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