Commit 6efda51cc5caad07b6a01d293daf913eec01901f
1 parent
5ee8c132
Exists in
master
and in
4 other branches
fix edit project members access link and page fixes refs #2745
Showing
4 changed files
with
5 additions
and
5 deletions
Show diff stats
app/controllers/admin/projects/application_controller.rb
@@ -6,6 +6,6 @@ class Admin::Projects::ApplicationController < Admin::ApplicationController | @@ -6,6 +6,6 @@ class Admin::Projects::ApplicationController < Admin::ApplicationController | ||
6 | protected | 6 | protected |
7 | 7 | ||
8 | def project | 8 | def project |
9 | - @project ||= Project.find_by_path(params[:project_id]) | 9 | + @project ||= Project.find_with_namespace(params[:project_id]) |
10 | end | 10 | end |
11 | end | 11 | end |
app/controllers/admin/projects/members_controller.rb
@@ -22,7 +22,7 @@ class Admin::Projects::MembersController < Admin::Projects::ApplicationControlle | @@ -22,7 +22,7 @@ class Admin::Projects::MembersController < Admin::Projects::ApplicationControlle | ||
22 | private | 22 | private |
23 | 23 | ||
24 | def team_member | 24 | def team_member |
25 | - @member ||= project.users.find(params[:id]) | 25 | + @member ||= project.users.find_by_username(params[:id]) |
26 | end | 26 | end |
27 | 27 | ||
28 | def team_member_relation | 28 | def team_member_relation |
app/views/admin/users/show.html.haml
@@ -123,5 +123,5 @@ | @@ -123,5 +123,5 @@ | ||
123 | %tr | 123 | %tr |
124 | %td= link_to project.name_with_namespace, admin_project_path(project) | 124 | %td= link_to project.name_with_namespace, admin_project_path(project) |
125 | %td= tm.project_access_human | 125 | %td= tm.project_access_human |
126 | - %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small" | ||
127 | - %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn small danger" | 126 | + %td= link_to 'Edit Access', edit_admin_project_member_path(project.path_with_namespace, tm.user.username), class: "btn small" |
127 | + %td= link_to 'Remove from team', admin_project_member_path(project.path_with_namespace, tm.user.username), confirm: 'Are you sure?', method: :delete, class: "btn small danger" |
config/routes.rb
@@ -84,7 +84,7 @@ Gitlab::Application.routes.draw do | @@ -84,7 +84,7 @@ Gitlab::Application.routes.draw do | ||
84 | get :team | 84 | get :team |
85 | put :team_update | 85 | put :team_update |
86 | end | 86 | end |
87 | - scope module: :projects, constraints: { id: /[^\/]+/ } do | 87 | + scope module: :projects, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } do |
88 | resources :members, only: [:edit, :update, :destroy] | 88 | resources :members, only: [:edit, :update, :destroy] |
89 | end | 89 | end |
90 | end | 90 | end |