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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
e2e0b175
Commit
e2e0b175
authored
Jun 22, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix specs
parent
12dc3992
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+3
-3
app/services/users/update_service.rb
app/services/users/update_service.rb
+1
-1
No files found.
app/controllers/admin/users_controller.rb
View file @
e2e0b175
...
@@ -156,11 +156,11 @@ class Admin::UsersController < Admin::ApplicationController
...
@@ -156,11 +156,11 @@ class Admin::UsersController < Admin::ApplicationController
respond_to
do
|
format
|
respond_to
do
|
format
|
if
success
if
success
format
.
html
{
redirect_back_or_admin_user
(
notice:
"Successfully removed email."
)
}
format
.
html
{
redirect_back_or_admin_user
(
notice:
'Successfully removed email.'
)
}
format
.
json
{
head
:ok
}
format
.
json
{
head
:ok
}
else
else
format
.
html
{
redirect_back_or_admin_user
(
alert:
result
[
:message
]
)
}
format
.
html
{
redirect_back_or_admin_user
(
alert:
'There was an error removing the e-mail.'
)
}
format
.
json
{
render
json:
result
[
:message
],
status:
result
[
:status
]
}
format
.
json
{
render
json:
'There was an error removing the e-mail.'
,
status:
400
}
end
end
end
end
end
end
...
...
app/services/users/update_service.rb
View file @
e2e0b175
...
@@ -10,7 +10,7 @@ module Users
...
@@ -10,7 +10,7 @@ module Users
def
execute
(
skip_authorization:
false
,
validate:
true
,
&
block
)
def
execute
(
skip_authorization:
false
,
validate:
true
,
&
block
)
assign_attributes
(
skip_authorization
,
&
block
)
assign_attributes
(
skip_authorization
,
&
block
)
if
@user
.
save
(
validate:
validate
)
||
@user
.
errors
.
empty?
if
@user
.
save
(
validate:
validate
)
success
success
else
else
error
(
@user
.
errors
.
full_messages
.
uniq
.
join
(
'. '
))
error
(
@user
.
errors
.
full_messages
.
uniq
.
join
(
'. '
))
...
...
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