diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-12-12 07:49:33 +0800 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2018-12-11 18:49:33 -0500 |
commit | b1f3685015246d3458f6d8c1d892eab076b3ed4a (patch) | |
tree | 4e909a78524095f0a34d8fe9ced2bdf86a6133e3 /models/branches.go | |
parent | 58c4559d3ba4a6b10e9bad3f84d53cc08edf7662 (diff) | |
download | gitea-b1f3685015246d3458f6d8c1d892eab076b3ed4a.tar.gz gitea-b1f3685015246d3458f6d8c1d892eab076b3ed4a.zip |
fix approvals limitation (#5521)
Diffstat (limited to 'models/branches.go')
-rw-r--r-- | models/branches.go | 3 |
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 { |