mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +00:00
Prevent allow/reject reviews on merged/closed PRs (#30686)
Resolves #30675. (cherry picked from commit dd301cae1c40c9ef2805bd13af6b09a81ff4f5d7) Conflicts: tests/integration/pull_review_test.go trivial context conflict in import
This commit is contained in:
parent
8ee31a6ba3
commit
4ed372af13
5 changed files with 119 additions and 14 deletions
|
@ -248,6 +248,8 @@ func SubmitReview(ctx *context.Context) {
|
|||
if issues_model.IsContentEmptyErr(err) {
|
||||
ctx.Flash.Error(ctx.Tr("repo.issues.review.content.empty"))
|
||||
ctx.JSONRedirect(fmt.Sprintf("%s/pulls/%d/files", ctx.Repo.RepoLink, issue.Index))
|
||||
} else if errors.Is(err, pull_service.ErrSubmitReviewOnClosedPR) {
|
||||
ctx.Status(http.StatusUnprocessableEntity)
|
||||
} else {
|
||||
ctx.ServerError("SubmitReview", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue