mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-18 13:13:14 +00:00
Allow to restart declined pipelines (#4109)
This commit is contained in:
@@ -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'"
|
||||
|
Reference in New Issue
Block a user