diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-22 20:08:33 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-23 20:38:35 -0500 |
commit | b0498c176fa134761d899c9b369be12f1ca789c5 (patch) | |
tree | dcf223813e0b1bb5932a94793a6f827771517a96 /config/routes/user.rb | |
parent | ed16c351c5acdf1ad2e401e72490320d06af6e91 (diff) | |
download | gitlab-ce-b0498c176fa134761d899c9b369be12f1ca789c5.tar.gz |
Remove changes that are not absolutely necessarydm-fix-routes
Diffstat (limited to 'config/routes/user.rb')
-rw-r--r-- | config/routes/user.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/config/routes/user.rb b/config/routes/user.rb index e682dcd6663..0f3bec9cf58 100644 --- a/config/routes/user.rb +++ b/config/routes/user.rb @@ -11,7 +11,19 @@ devise_scope :user do get '/users/almost_there' => 'confirmations#almost_there' end -scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) do +constraints(UserUrlConstrainer.new) do + # Get all keys of user + get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: Gitlab::Regex.root_namespace_route_regex } + + scope(path: ':username', + as: :user, + constraints: { username: Gitlab::Regex.root_namespace_route_regex }, + controller: :users) do + get '/', action: :show + end +end + +scope(constraints: { username: Gitlab::Regex.root_namespace_route_regex }) do scope(path: 'users/:username', as: :user, controller: :users) do @@ -22,7 +34,7 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d get :contributed, as: :contributed_projects get :snippets get :exists - get '/', to: redirect('/%{username}'), as: nil + get '/', to: redirect('/%{username}') end # Compatibility with old routing @@ -34,15 +46,3 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d get '/u/:username/snippets', to: redirect('/users/%{username}/snippets') get '/u/:username/contributed', to: redirect('/users/%{username}/contributed') end - -constraints(UserUrlConstrainer.new) do - # Get all keys of user - get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: Gitlab::PathRegex.root_namespace_route_regex } - - scope(path: ':username', - as: :user, - constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }, - controller: :users) do - get '/', action: :show - end -end |