aboutsummaryrefslogtreecommitdiffstats
path: root/models/review.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-12-30 23:34:11 +0000
committertechknowlogick <techknowlogick@gitea.io>2019-12-30 18:34:11 -0500
commit0c07f1de5b8cf7b9f9f607aae76a53c99aeb2c04 (patch)
treed9dcb3161784f012ae80429aae8a9576894e0fd2 /models/review.go
parentb983ff447387d40700ad8c0a56f90052878fec98 (diff)
downloadgitea-0c07f1de5b8cf7b9f9f607aae76a53c99aeb2c04.tar.gz
gitea-0c07f1de5b8cf7b9f9f607aae76a53c99aeb2c04.zip
Provide Default messages for merges (#9393)
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'models/review.go')
-rw-r--r--models/review.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/models/review.go b/models/review.go
index 493959e78e..bc7dfbcd14 100644
--- a/models/review.go
+++ b/models/review.go
@@ -125,9 +125,10 @@ func GetReviewByID(id int64) (*Review, error) {
// FindReviewOptions represent possible filters to find reviews
type FindReviewOptions struct {
- Type ReviewType
- IssueID int64
- ReviewerID int64
+ Type ReviewType
+ IssueID int64
+ ReviewerID int64
+ OfficialOnly bool
}
func (opts *FindReviewOptions) toCond() builder.Cond {
@@ -141,6 +142,9 @@ func (opts *FindReviewOptions) toCond() builder.Cond {
if opts.Type != ReviewTypeUnknown {
cond = cond.And(builder.Eq{"type": opts.Type})
}
+ if opts.OfficialOnly {
+ cond = cond.And(builder.Eq{"official": true})
+ }
return cond
}