diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-05-05 10:01:21 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-05-05 10:01:21 +0000 |
commit | a5347fe58f6ace1ced67fa32a8469ba4e2819606 (patch) | |
tree | e43e4ebf00fed4a0c8e0f931bf09193f37db7f66 /app/controllers | |
parent | 07eac529fc0ec30ff6bea2bba01c68b72fee4f14 (diff) | |
parent | 4f3dc19aafdd71aedb6b086da5707315a9a51ace (diff) | |
download | gitlab-ce-a5347fe58f6ace1ced67fa32a8469ba4e2819606.tar.gz |
Merge branch '30237-pipelines-actions-make-2-requests' into 'master'
Resolve: "Pipelines: When we retry a pipeline 2 requests are made to the pipelines endpoint"
Closes #30237
See merge request !10584
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/pipelines_controller.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index 454b8ee17af..2908036607a 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -6,6 +6,8 @@ class Projects::PipelinesController < Projects::ApplicationController before_action :authorize_update_pipeline!, only: [:retry, :cancel] before_action :builds_enabled, only: :charts + wrap_parameters Ci::Pipeline + def index @scope = params[:scope] @pipelines = PipelinesFinder @@ -92,13 +94,25 @@ class Projects::PipelinesController < Projects::ApplicationController def retry pipeline.retry_failed(current_user) - redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) + respond_to do |format| + format.html do + redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) + end + + format.json { head :no_content } + end end def cancel pipeline.cancel_running - redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) + respond_to do |format| + format.html do + redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) + end + + format.json { head :no_content } + end end def charts |