aboutsummaryrefslogtreecommitdiffstats
path: root/models/branches.go
diff options
context:
space:
mode:
authorJohn Olheiser <42128690+jolheiser@users.noreply.github.com>2019-12-13 09:37:10 -0600
committertechknowlogick <techknowlogick@gitea.io>2019-12-13 10:37:10 -0500
commitf09cdb239cb7e2d96c6bc9d5d43ada165b1240d1 (patch)
treedfa304525ba65bd216dceec3c6d183a8c641178f /models/branches.go
parent6e6936d73d00cfb0bb6131b1b919807e3d4b1f73 (diff)
downloadgitea-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.go2
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))