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
Jérome Perrin
gitlab-ce
Commits
c8227889
Commit
c8227889
authored
Oct 19, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor groups/projects members controller
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
036fac06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
app/controllers/groups/group_members_controller.rb
app/controllers/groups/group_members_controller.rb
+1
-1
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+10
-8
No files found.
app/controllers/groups/group_members_controller.rb
View file @
c8227889
...
...
@@ -21,7 +21,7 @@ class Groups::GroupMembersController < Groups::ApplicationController
end
def
create
if
params
[
:user_ids
].
empty
?
if
params
[
:user_ids
].
blank
?
return
redirect_to
group_group_members_path
(
@group
),
alert:
'No users specified.'
end
...
...
app/controllers/projects/project_members_controller.rb
View file @
c8227889
...
...
@@ -25,16 +25,18 @@ class Projects::ProjectMembersController < Projects::ApplicationController
end
def
create
if
params
[
:user_ids
].
empty
?
return
redirect_to
namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
alert:
'No users specified.'
if
params
[
:user_ids
].
blank?
&&
params
[
:group_ids
].
blank
?
return
redirect_to
namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
alert:
'No users
or groups
specified.'
end
@project
.
team
.
add_users
(
params
[
:user_ids
].
split
(
','
),
params
[
:access_level
],
expires_at:
params
[
:expires_at
],
current_user:
current_user
)
if
params
[
:user_ids
].
present?
@project
.
team
.
add_users
(
params
[
:user_ids
].
split
(
','
),
params
[
:access_level
],
expires_at:
params
[
:expires_at
],
current_user:
current_user
)
end
redirect_to
namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
notice:
'Users were successfully added.'
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