Skip to content

Commit 4b5ebb9

Browse files
jolheiserzeripath
authored andcommitted
New review approvals shouldn't require a message (#8991)
* New approvals don't require content Signed-off-by: jolheiser <[email protected]> * Fix edge-bug Signed-off-by: jolheiser <[email protected]>
1 parent ae36ed7 commit 4b5ebb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

models/review.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ func SubmitReview(doer *User, issue *Issue, reviewType ReviewType, content strin
254254
return nil, nil, err
255255
}
256256

257-
if len(strings.TrimSpace(content)) == 0 {
257+
if reviewType != ReviewTypeApprove && len(strings.TrimSpace(content)) == 0 {
258258
return nil, nil, ContentEmptyErr{}
259259
}
260260

@@ -272,7 +272,7 @@ func SubmitReview(doer *User, issue *Issue, reviewType ReviewType, content strin
272272
if err := review.loadCodeComments(sess); err != nil {
273273
return nil, nil, err
274274
}
275-
if len(review.CodeComments) == 0 && len(strings.TrimSpace(content)) == 0 {
275+
if reviewType != ReviewTypeApprove && len(review.CodeComments) == 0 && len(strings.TrimSpace(content)) == 0 {
276276
return nil, nil, ContentEmptyErr{}
277277
}
278278

0 commit comments

Comments
 (0)