Skip to content

Commit

Permalink
Fix protected branch using IssueID (#9348)
Browse files Browse the repository at this point in the history
Signed-off-by: jolheiser <[email protected]>
  • Loading branch information
jolheiser authored and techknowlogick committed Dec 13, 2019
1 parent 6e6936d commit f09cdb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit f09cdb2

Please sign in to comment.