BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
12dc3992
Commit
12dc3992
authored
Jun 22, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spec failures
parent
0ee002c7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
users.rb
lib/api/users.rb
+6
-4
No files found.
lib/api/users.rb
View file @
12dc3992
...
...
@@ -236,7 +236,9 @@ module API
user
=
User
.
find_by
(
id:
params
.
delete
(
:id
))
not_found!
(
'User'
)
unless
user
if
Emails
::
CreateService
.
new
(
current_user
,
user
,
declared_params
(
include_missing:
false
)).
execute
(
skip_authorization:
true
)
email
=
Emails
::
CreateService
.
new
(
current_user
,
user
,
declared_params
(
include_missing:
false
)).
execute
if
email
.
errors
.
blank?
NotificationService
.
new
.
new_email
(
email
)
present
email
,
with:
Entities
::
Email
else
...
...
@@ -274,7 +276,7 @@ module API
email
=
user
.
emails
.
find_by
(
id:
params
[
:email_id
])
not_found!
(
'Email'
)
unless
email
Emails
::
DestroyService
.
new
(
current_user
,
user
,
email:
email
.
email
).
execute
(
skip_authorization:
true
)
Emails
::
DestroyService
.
new
(
current_user
,
user
,
email:
email
.
email
).
execute
end
desc
'Delete a user. Available only for admins.'
do
...
...
@@ -486,9 +488,9 @@ module API
requires
:email
,
type:
String
,
desc:
'The new email'
end
post
"emails"
do
email
=
current_user
.
emails
.
new
(
declared_params
)
email
=
Emails
::
CreateService
.
new
(
current_user
,
current_user
,
declared_params
).
execute
if
Emails
::
CreateService
.
new
(
current_user
,
current_user
,
declared_params
).
execute
if
email
.
errors
.
blank?
NotificationService
.
new
.
new_email
(
email
)
present
email
,
with:
Entities
::
Email
else
...
...
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