diff options
author | John Olheiser <42128690+jolheiser@users.noreply.github.com> | 2019-12-13 09:37:10 -0600 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-12-13 10:37:10 -0500 |
commit | f09cdb239cb7e2d96c6bc9d5d43ada165b1240d1 (patch) | |
tree | dfa304525ba65bd216dceec3c6d183a8c641178f /models/branches.go | |
parent | 6e6936d73d00cfb0bb6131b1b919807e3d4b1f73 (diff) | |
download | gitea-f09cdb239cb7e2d96c6bc9d5d43ada165b1240d1.tar.gz gitea-f09cdb239cb7e2d96c6bc9d5d43ada165b1240d1.zip |
Fix protected branch using IssueID (#9348)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'models/branches.go')
-rw-r--r-- | models/branches.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/branches.go b/models/branches.go index cf4b4fe393..bb99cffa05 100644 --- a/models/branches.go +++ b/models/branches.go @@ -153,7 +153,7 @@ func (protectBranch *ProtectedBranch) HasEnoughApprovals(pr *PullRequest) bool { // GetGrantedApprovalsCount returns the number of granted approvals for pr. A granted approval must be authored by a user in an approval whitelist. func (protectBranch *ProtectedBranch) GetGrantedApprovalsCount(pr *PullRequest) int64 { - approvals, err := x.Where("issue_id = ?", pr.Issue.ID). + approvals, err := x.Where("issue_id = ?", pr.IssueID). And("type = ?", ReviewTypeApprove). And("official = ?", true). Count(new(Review)) |