mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix protected branch using IssueID (#9348)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
		
				
					committed by
					
						
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							6e6936d73d
						
					
				
				
					commit
					f09cdb239c
				
			@@ -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))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user