summaryrefslogtreecommitdiffstats
path: root/models/branches.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-12-12 07:49:33 +0800
committertechknowlogick <hello@techknowlogick.com>2018-12-11 18:49:33 -0500
commitb1f3685015246d3458f6d8c1d892eab076b3ed4a (patch)
tree4e909a78524095f0a34d8fe9ced2bdf86a6133e3 /models/branches.go
parent58c4559d3ba4a6b10e9bad3f84d53cc08edf7662 (diff)
downloadgitea-b1f3685015246d3458f6d8c1d892eab076b3ed4a.tar.gz
gitea-b1f3685015246d3458f6d8c1d892eab076b3ed4a.zip
fix approvals limitation (#5521)
Diffstat (limited to 'models/branches.go')
-rw-r--r--models/branches.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/branches.go b/models/branches.go
index f2bf9a80a0..a1e97ffaaa 100644
--- a/models/branches.go
+++ b/models/branches.go
@@ -99,11 +99,12 @@ 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 {
- reviews, err := GetReviewersByPullID(pr.ID)
+ reviews, err := GetReviewersByPullID(pr.Issue.ID)
if err != nil {
log.Error(1, "GetUniqueApprovalsByPullRequestID:", err)
return 0
}
+
approvals := int64(0)
userIDs := make([]int64, 0)
for _, review := range reviews {