From 83926133d4e0249e1040a7a75bd622d3cb18f17b Mon Sep 17 00:00:00 2001 From: qwerty287 <80460567+qwerty287@users.noreply.github.com> Date: Sat, 14 Sep 2024 18:27:45 +0300 Subject: [PATCH] Allow to restart declined pipelines (#4109) --- server/pipeline/restart.go | 6 ++---- web/src/views/repo/pipeline/PipelineWrapper.vue | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/server/pipeline/restart.go b/server/pipeline/restart.go index da0888511..3c997a290 100644 --- a/server/pipeline/restart.go +++ b/server/pipeline/restart.go @@ -36,10 +36,8 @@ func Restart(ctx context.Context, store store.Store, lastPipeline *model.Pipelin return nil, errors.New(msg) } - switch lastPipeline.Status { - case model.StatusDeclined, - model.StatusBlocked: - return nil, &ErrBadRequest{Msg: fmt.Sprintf("cannot restart a pipeline with status %s", lastPipeline.Status)} + if lastPipeline.Status == model.StatusBlocked { + return nil, &ErrBadRequest{Msg: "cannot restart a pipeline with status blocked"} } // fetch the old pipeline config from the database diff --git a/web/src/views/repo/pipeline/PipelineWrapper.vue b/web/src/views/repo/pipeline/PipelineWrapper.vue index dff059e24..a0b898c4c 100644 --- a/web/src/views/repo/pipeline/PipelineWrapper.vue +++ b/web/src/views/repo/pipeline/PipelineWrapper.vue @@ -31,7 +31,7 @@ }} -