Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
b9e573db
Commit
b9e573db
authored
Apr 26, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip validation when creating internal (ghost, service desk) users
parent
d39b16d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
app/models/user.rb
app/models/user.rb
+3
-1
changelogs/unreleased/dm-fix-ghost-user-validation.yml
changelogs/unreleased/dm-fix-ghost-user-validation.yml
+4
-0
spec/models/user_spec.rb
spec/models/user_spec.rb
+10
-0
No files found.
app/models/user.rb
View file @
b9e573db
...
@@ -1068,11 +1068,13 @@ class User < ActiveRecord::Base
...
@@ -1068,11 +1068,13 @@ class User < ActiveRecord::Base
User
.
find_by_email
(
s
)
User
.
find_by_email
(
s
)
end
end
scope
.
create
(
user
=
scope
.
build
(
username:
username
,
username:
username
,
email:
email
,
email:
email
,
&
creation_block
&
creation_block
)
)
user
.
save
(
validate:
false
)
user
ensure
ensure
Gitlab
::
ExclusiveLease
.
cancel
(
lease_key
,
uuid
)
Gitlab
::
ExclusiveLease
.
cancel
(
lease_key
,
uuid
)
end
end
...
...
changelogs/unreleased/dm-fix-ghost-user-validation.yml
0 → 100644
View file @
b9e573db
---
title
:
Skip validation when creating internal (ghost, service desk) users
merge_request
:
author
:
spec/models/user_spec.rb
View file @
b9e573db
...
@@ -1556,6 +1556,16 @@ describe User, models: true do
...
@@ -1556,6 +1556,16 @@ describe User, models: true do
expect
(
ghost
.
email
).
to
eq
(
'ghost1@example.com'
)
expect
(
ghost
.
email
).
to
eq
(
'ghost1@example.com'
)
end
end
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
end
describe
'#update_two_factor_requirement'
do
describe
'#update_two_factor_requirement'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment