summaryrefslogtreecommitdiffstats
path: root/models/review.go
diff options
context:
space:
mode:
authorJohn Olheiser <42128690+jolheiser@users.noreply.github.com>2019-11-14 14:58:01 -0600
committerzeripath <art27@cantab.net>2019-11-14 20:58:01 +0000
commit4b5ebb93e48f04227ec18cf042e916df4eafe830 (patch)
tree23c4e1daa1cba1a5e097edef77664212e1f7cc53 /models/review.go
parentae36ed7ecb454e1b43f879b0c40b570a297d4cca (diff)
downloadgitea-4b5ebb93e48f04227ec18cf042e916df4eafe830.tar.gz
gitea-4b5ebb93e48f04227ec18cf042e916df4eafe830.zip
New review approvals shouldn't require a message (#8991)
* New approvals don't require content Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix edge-bug Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'models/review.go')
-rw-r--r--models/review.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/review.go b/models/review.go
index 441bb40fbb..e1674e885d 100644
--- a/models/review.go
+++ b/models/review.go
@@ -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{}
}
@@ -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 {
return nil, nil, ContentEmptyErr{}
}