summaryrefslogtreecommitdiff
path: root/app/controllers/projects/jobs_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/jobs_controller.rb')
-rw-r--r--app/controllers/projects/jobs_controller.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb
index c6d442a6f27..3fea5c694f7 100644
--- a/app/controllers/projects/jobs_controller.rb
+++ b/app/controllers/projects/jobs_controller.rb
@@ -1,14 +1,15 @@
# frozen_string_literal: true
class Projects::JobsController < Projects::ApplicationController
+ include Ci::AuthBuildTrace
include SendFileUpload
include ContinueParams
include ProjectStatsRefreshConflictsGuard
urgency :low, [:index, :show, :trace, :retry, :play, :cancel, :unschedule, :erase, :raw]
- before_action :find_job_as_build, except: [:index, :play, :show]
- before_action :find_job_as_processable, only: [:play, :show]
+ before_action :find_job_as_build, except: [:index, :play, :show, :retry]
+ before_action :find_job_as_processable, only: [:play, :show, :retry]
before_action :authorize_read_build_trace!, only: [:trace, :raw]
before_action :authorize_read_build!
before_action :authorize_update_build!,
@@ -76,7 +77,11 @@ class Projects::JobsController < Projects::ApplicationController
response = Ci::RetryJobService.new(project, current_user).execute(@build)
if response.success?
- redirect_to build_path(response[:job])
+ if @build.is_a?(::Ci::Build)
+ redirect_to build_path(response[:job])
+ else
+ head :ok
+ end
else
respond_422
end