Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New review approvals shouldn't require a message #8991

Merged
merged 6 commits into from
Nov 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions models/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func SubmitReview(doer *User, issue *Issue, reviewType ReviewType, content strin
return nil, nil, err
}

if len(strings.TrimSpace(content)) == 0 {
if reviewType != ReviewTypeApprove && len(strings.TrimSpace(content)) == 0 {
return nil, nil, ContentEmptyErr{}
}

Expand All @@ -272,7 +272,7 @@ func SubmitReview(doer *User, issue *Issue, reviewType ReviewType, content strin
if err := review.loadCodeComments(sess); err != nil {
return nil, nil, err
}
if len(review.CodeComments) == 0 && len(strings.TrimSpace(content)) == 0 {
if reviewType != ReviewTypeApprove && len(review.CodeComments) == 0 && len(strings.TrimSpace(content)) == 0 {
jolheiser marked this conversation as resolved.
Show resolved Hide resolved
return nil, nil, ContentEmptyErr{}
}

Expand Down