Commit a434ffd3 authored by Rémy Coutable's avatar Rémy Coutable

Make /profile/keys/new redirects to /profile/keys for back-compat

Report: https://github.com/gitlabhq/gitlabhq/issues/10138Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 595aba54
...@@ -15,6 +15,7 @@ v 8.7.0 (unreleased) ...@@ -15,6 +15,7 @@ v 8.7.0 (unreleased)
- Don't attempt to look up an avatar in repo if repo directory does not exist (Stan Hu) - Don't attempt to look up an avatar in repo if repo directory does not exist (Stan Hu)
- API: Ability to subscribe and unsubscribe from issues and merge requests (Robert Schilling) - API: Ability to subscribe and unsubscribe from issues and merge requests (Robert Schilling)
- Expose project badges in project settings - Expose project badges in project settings
- Make /profile/keys/new redirect to /profile/keys for back-compat. !3717
- Preserve time notes/comments have been updated at when moving issue - Preserve time notes/comments have been updated at when moving issue
- Make HTTP(s) label consistent on clone bar (Stan Hu) - Make HTTP(s) label consistent on clone bar (Stan Hu)
- Expose label description in API (Mariusz Jachimowicz) - Expose label description in API (Mariusz Jachimowicz)
......
...@@ -10,6 +10,11 @@ class Profiles::KeysController < Profiles::ApplicationController ...@@ -10,6 +10,11 @@ class Profiles::KeysController < Profiles::ApplicationController
@key = current_user.keys.find(params[:id]) @key = current_user.keys.find(params[:id])
end end
# Back-compat: We need to support this URL since git-annex webapp points to it
def new
redirect_to profile_keys_path
end
def create def create
@key = current_user.keys.new(key_params) @key = current_user.keys.new(key_params)
......
...@@ -326,7 +326,7 @@ Rails.application.routes.draw do ...@@ -326,7 +326,7 @@ Rails.application.routes.draw do
end end
end end
resource :preferences, only: [:show, :update] resource :preferences, only: [:show, :update]
resources :keys, except: [:new] resources :keys
resources :emails, only: [:index, :create, :destroy] resources :emails, only: [:index, :create, :destroy]
resource :avatar, only: [:destroy] resource :avatar, only: [:destroy]
resource :two_factor_auth, only: [:new, :create, :destroy] do resource :two_factor_auth, only: [:new, :create, :destroy] do
......
...@@ -3,6 +3,16 @@ require 'spec_helper' ...@@ -3,6 +3,16 @@ require 'spec_helper'
describe Profiles::KeysController do describe Profiles::KeysController do
let(:user) { create(:user) } let(:user) { create(:user) }
describe '#new' do
before { sign_in(user) }
it 'redirect to #index' do
get :new
expect(response).to redirect_to(profile_keys_path)
end
end
describe "#get_keys" do describe "#get_keys" do
describe "non existant user" do describe "non existant user" do
it "should generally not work" do it "should generally not work" do
......
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