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
cf129d6f
Commit
cf129d6f
authored
Feb 26, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '6-6-3-patch' into '6-6-stable'
6.6.3 Patch Fixes 500 error when try to edit own user via admin area
parents
4ef83692
98f4665e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
2 deletions
+24
-2
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+3
-1
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+1
-0
app/views/users/show.html.haml
app/views/users/show.html.haml
+1
-1
features/admin/users.feature
features/admin/users.feature
+6
-0
features/steps/admin/admin_users.rb
features/steps/admin/admin_users.rb
+13
-0
No files found.
app/controllers/admin/users_controller.rb
View file @
cf129d6f
...
...
@@ -68,7 +68,9 @@ class Admin::UsersController < Admin::ApplicationController
params
[
:user
].
delete
(
:password_confirmation
)
end
user
.
admin
=
(
admin
&&
admin
.
to_i
>
0
)
if
admin
.
present?
user
.
admin
=
!
admin
.
to_i
.
zero?
end
respond_to
do
|
format
|
if
user
.
update_attributes
(
params
[
:user
],
as: :admin
)
...
...
app/controllers/users_controller.rb
View file @
cf129d6f
...
...
@@ -11,6 +11,7 @@ class UsersController < ApplicationController
end
@events
=
@user
.
recent_events
.
where
(
project_id:
@projects
.
map
(
&
:id
)).
limit
(
20
)
@title
=
@user
.
name
@groups
=
@projects
.
map
(
&
:group
).
compact
.
uniq
end
def
determine_layout
...
...
app/views/users/show.html.haml
View file @
cf129d6f
...
...
@@ -14,7 +14,7 @@
%small
member since
#{
@user
.
created_at
.
stamp
(
"Nov 12, 2031"
)
}
.clearfix
%h4
Groups:
=
render
'groups'
,
groups:
@
user
.
groups
=
render
'groups'
,
groups:
@
groups
%hr
%h4
User Activity:
=
render
@events
...
...
features/admin/users.feature
View file @
cf129d6f
...
...
@@ -14,3 +14,9 @@ Feature: Admin Users
And
Click save
Then
See username error message
And
Not changed form action url
Scenario
:
Edit my user attributes
Given
I visit admin users page
And
click edit on my user
When
I submit modified user
Then
I see user attributes changed
features/steps/admin/admin_users.rb
View file @
cf129d6f
...
...
@@ -31,4 +31,17 @@ class AdminUsers < Spinach::FeatureSteps
And
'Not changed form action url'
do
page
.
should
have_selector
%(form[action="/admin/users/#{@user.username}"])
end
step
'I submit modified user'
do
check
:user_can_create_group
click_button
'Save'
end
step
'I see user attributes changed'
do
page
.
should
have_content
'Can create groups: Yes'
end
step
'click edit on my user'
do
find
(
"#edit_user_
#{
current_user
.
id
}
"
).
click
end
end
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