Revert "Prevent allow/reject reviews on merged/closed PRs"

This reverts commit 4ed372af13.
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
This commit is contained in:
Caesar Schinas 2024-08-09 16:32:44 +01:00
parent 8359b26d3f
commit 65c2595f26
No known key found for this signature in database
GPG key ID: AE9108461BEA5ACF
5 changed files with 45 additions and 41 deletions

View file

@ -248,8 +248,6 @@ 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)
}