Allow to restart declined pipelines (#4109)

This commit is contained in:
qwerty287 2024-09-14 18:27:45 +03:00 committed by GitHub
parent 84c1b92899
commit 83926133d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View file

@ -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

View file

@ -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'"