forked from forgejo/forgejo
prevent empty review comment (#4632)
* prevent empty review comment This would only require a comment for rejection and comment * add tests * add comment
This commit is contained in:
parent
59b10e66f7
commit
0df7cab4fb
4 changed files with 57 additions and 0 deletions
|
@ -107,6 +107,13 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {
|
|||
ctx.ServerError("GetCurrentReview", fmt.Errorf("unknown ReviewType: %s", form.Type))
|
||||
return
|
||||
}
|
||||
|
||||
if form.HasEmptyContent() {
|
||||
ctx.Flash.Error(ctx.Tr("repo.issues.review.content.empty"))
|
||||
ctx.Redirect(fmt.Sprintf("%s/pulls/%d", ctx.Repo.RepoLink, issue.Index))
|
||||
return
|
||||
}
|
||||
|
||||
review, err = models.GetCurrentReview(ctx.User, issue)
|
||||
if err != nil {
|
||||
if !models.IsErrReviewNotExist(err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue