diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-01-30 13:21:02 -0600 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-03-06 09:47:44 -0600 |
commit | 2ee86441158076344a07f2715a148a5bdbe161b0 (patch) | |
tree | 2bf1f0dc0c49b3e888e7cd8ad6875e14899f0fef /app/controllers/projects/protected_branches_controller.rb | |
parent | 0b74ae849d3f87564e789673ecf67aa54ec7cd8a (diff) | |
download | gitlab-ce-2ee86441158076344a07f2715a148a5bdbe161b0.tar.gz |
Fixed tests, changed dispatcher routing to the 'repository:show'
Also modified the render calls to the deploy_keys and protected_branches
partials
Diffstat (limited to 'app/controllers/projects/protected_branches_controller.rb')
-rw-r--r-- | app/controllers/projects/protected_branches_controller.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/app/controllers/projects/protected_branches_controller.rb b/app/controllers/projects/protected_branches_controller.rb index 18d25f91c96..ac886f0739a 100644 --- a/app/controllers/projects/protected_branches_controller.rb +++ b/app/controllers/projects/protected_branches_controller.rb @@ -1,9 +1,9 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController + include RepositoryHelper # Authorize before_action :require_non_empty_project before_action :authorize_admin_project! before_action :load_protected_branch, only: [:show, :update, :destroy] - before_action :load_protected_branches, only: [:index] layout "project_settings" @@ -13,13 +13,10 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController def create @protected_branch = ::ProtectedBranches::CreateService.new(@project, current_user, protected_branch_params).execute - if @protected_branch.persisted? - redirect_to namespace_project_settings_repository_path(@project.namespace, @project) - else - load_protected_branches - load_gon_index - render :index + unless @protected_branch.persisted? + flash[:alert] = @protected_branches.errors.full_messages.join(',').html_safe end + redirect_to namespace_project_settings_repository_path(@project.namespace, @project) end def show |