|
|
@ -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.
|
|
|
|
// 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 { |
|
|
|
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("type = ?", ReviewTypeApprove). |
|
|
|
And("official = ?", true). |
|
|
|
And("official = ?", true). |
|
|
|
Count(new(Review)) |
|
|
|
Count(new(Review)) |
|
|
|