mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-25 11:21:02 +00:00
Allow to restart declined pipelines (#4109)
This commit is contained in:
parent
84c1b92899
commit
83926133d4
2 changed files with 3 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
}}</span>
|
||||
</div>
|
||||
|
||||
<template v-if="repoPermissions!.push && pipeline.status !== 'declined' && pipeline.status !== 'blocked'">
|
||||
<template v-if="repoPermissions!.push && pipeline.status !== 'blocked'">
|
||||
<div class="flex content-start gap-x-2">
|
||||
<Button
|
||||
v-if="pipeline.status === 'pending' || pipeline.status === 'running'"
|
||||
|
|
Loading…
Reference in a new issue