diff options
Diffstat (limited to 'app/controllers/projects/protected_branches_controller.rb')
-rw-r--r-- | app/controllers/projects/protected_branches_controller.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/app/controllers/projects/protected_branches_controller.rb b/app/controllers/projects/protected_branches_controller.rb index 1c22b9c2ca8..b7817a71e0d 100644 --- a/app/controllers/projects/protected_branches_controller.rb +++ b/app/controllers/projects/protected_branches_controller.rb @@ -1,4 +1,5 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController + include RedirectRequest # Authorize before_action :require_non_empty_project before_action :authorize_admin_project! @@ -7,15 +8,15 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController layout "project_settings" def index - redirect_to namespace_project_settings_repository_path(@project.namespace, @project) + redirect_to_repository_settings(@project) end def create @protected_branch = ::ProtectedBranches::CreateService.new(@project, current_user, protected_branch_params).execute unless @protected_branch.persisted? - flash[:alert] = @protected_branches.errors.full_messages.join(',').html_safe + flash[:alert] = @protected_branches.errors.full_messages.join(', ').html_safe end - redirect_to namespace_project_settings_repository_path(@project.namespace, @project) + redirect_to_repository_settings(@project) end def show @@ -40,7 +41,7 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController @protected_branch.destroy respond_to do |format| - format.html { redirect_to namespace_project_settings_repository_path } + format.html { redirect_to_repository_settings(@project) } format.js { head :ok } end end @@ -56,8 +57,4 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController merge_access_levels_attributes: [:access_level, :id], push_access_levels_attributes: [:access_level, :id]) end - - def load_protected_branches - @protected_branches = @project.protected_branches.order(:name).page(params[:page]) - end end |