mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-06-27 21:00:05 +02:00
Revert "Prevent allow/reject reviews on merged/closed PRs"
This reverts commit4ed372af13
. This change from Gitea was not considered by the Forgejo UI team and there is a consensus that it feels like a regression. The test which was added in that commit is kept and modified to test that reviews can successfully be submitted on closed and merged PRs. Closes forgejo/design#11 (cherry picked from commit65c2595f26
)
This commit is contained in:
parent
35c206317b
commit
dfd3ac01d7
5 changed files with 45 additions and 41 deletions
|
@ -4,7 +4,6 @@
|
|||
package repo
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
@ -520,11 +519,7 @@ func CreatePullReview(ctx *context.APIContext) {
|
|||
// create review and associate all pending review comments
|
||||
review, _, err := pull_service.SubmitReview(ctx, ctx.Doer, ctx.Repo.GitRepo, pr.Issue, reviewType, opts.Body, opts.CommitID, nil)
|
||||
if err != nil {
|
||||
if errors.Is(err, pull_service.ErrSubmitReviewOnClosedPR) {
|
||||
ctx.Error(http.StatusUnprocessableEntity, "", err)
|
||||
} else {
|
||||
ctx.Error(http.StatusInternalServerError, "SubmitReview", err)
|
||||
}
|
||||
ctx.Error(http.StatusInternalServerError, "SubmitReview", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -612,11 +607,7 @@ func SubmitPullReview(ctx *context.APIContext) {
|
|||
// create review and associate all pending review comments
|
||||
review, _, err = pull_service.SubmitReview(ctx, ctx.Doer, ctx.Repo.GitRepo, pr.Issue, reviewType, opts.Body, headCommitID, nil)
|
||||
if err != nil {
|
||||
if errors.Is(err, pull_service.ErrSubmitReviewOnClosedPR) {
|
||||
ctx.Error(http.StatusUnprocessableEntity, "", err)
|
||||
} else {
|
||||
ctx.Error(http.StatusInternalServerError, "SubmitReview", err)
|
||||
}
|
||||
ctx.Error(http.StatusInternalServerError, "SubmitReview", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue