Commit 0125b74b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix application crashes after #2772

parent 71e89df5
class Admin::UsersController < Admin::ApplicationController class Admin::UsersController < Admin::ApplicationController
before_filter :admin_user, only: [:show, :edit, :update, :destroy]
def index def index
@admin_users = User.scoped @admin_users = User.scoped
@admin_users = @admin_users.filter(params[:filter]) @admin_users = @admin_users.filter(params[:filter])
...@@ -7,11 +9,8 @@ class Admin::UsersController < Admin::ApplicationController ...@@ -7,11 +9,8 @@ class Admin::UsersController < Admin::ApplicationController
end end
def show def show
projects = if admin_user.authorized_projects.empty? @projects = Project.scoped
Project @projects = @projects.without_user(admin_user) if admin_user.authorized_projects.empty?
else
Project.without_user(admin_user)
end.all
end end
def team_update def team_update
...@@ -102,6 +101,6 @@ class Admin::UsersController < Admin::ApplicationController ...@@ -102,6 +101,6 @@ class Admin::UsersController < Admin::ApplicationController
protected protected
def admin_user def admin_user
@admin_user ||= User.find_by_username(params[:id]) @admin_user ||= User.find_by_username!(params[:id])
end end
end end
...@@ -49,7 +49,7 @@ Gitlab::Application.routes.draw do ...@@ -49,7 +49,7 @@ Gitlab::Application.routes.draw do
# Admin Area # Admin Area
# #
namespace :admin do namespace :admin do
resources :users do resources :users, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } do
member do member do
put :team_update put :team_update
put :block put :block
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment