]> source.dussan.org Git - gitea.git/commitdiff
Fix protected branch using IssueID (#9348)
authorJohn Olheiser <42128690+jolheiser@users.noreply.github.com>
Fri, 13 Dec 2019 15:37:10 +0000 (09:37 -0600)
committertechknowlogick <techknowlogick@gitea.io>
Fri, 13 Dec 2019 15:37:10 +0000 (10:37 -0500)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
models/branches.go

index cf4b4fe3932054344a917a3464b670981e1a44a0..bb99cffa05330e98d60ae63f132777a1d474c1e2 100644 (file)
@@ -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))