Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-01-30 22:21:02 +0300
committerJose Ivan Vargas <jvargas@gitlab.com>2017-03-06 18:47:44 +0300
commit2ee86441158076344a07f2715a148a5bdbe161b0 (patch)
tree2bf1f0dc0c49b3e888e7cd8ad6875e14899f0fef /app/controllers/projects/protected_branches_controller.rb
parent0b74ae849d3f87564e789673ecf67aa54ec7cd8a (diff)
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.rb11
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