diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 0192b1c253e28818ef21c79cb44b746f2825970e..87b8ef033138e566f2614c451e79c7c4805186b4 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -124,8 +124,8 @@ class GroupsController < Groups::ApplicationController flash[:notice] = "Group '#{@group.name}' was successfully transferred." redirect_to group_path(@group) else - flash.now[:alert] = service.error - render :edit + flash[:alert] = service.error + redirect_to edit_group_path(@group) end end # rubocop: enable CodeReuse/ActiveRecord diff --git a/changelogs/unreleased/xanf-gitlab-ce-transfer-disables-js.yml b/changelogs/unreleased/xanf-gitlab-ce-transfer-disables-js.yml new file mode 100644 index 0000000000000000000000000000000000000000..57c9a1aaa48016d68359799729895c6643497bba --- /dev/null +++ b/changelogs/unreleased/xanf-gitlab-ce-transfer-disables-js.yml @@ -0,0 +1,5 @@ +--- +title: Group transfer now properly redirects to edit on failure +merge_request: 26837 +author: +type: fixed diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index b2e6df6060ae20a7e5e19f194f1bc89ecbf6f685..38d7240ea81bcaf556207fb110724882970d0640 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -616,7 +616,7 @@ describe GroupsController do end it 'should redirect to the current path' do - expect(response).to render_template(:edit) + expect(response).to redirect_to(edit_group_path(group)) end end