Simplification
* simplifies fetching of intervention's deductions
This commit is contained in:
		
							parent
							
								
									3eff97b6dd
								
							
						
					
					
						commit
						8a84df0fcd
					
				@ -312,9 +312,7 @@ class Intervention(BaseObject,
 | 
			
		||||
        super().mark_as_deleted(user, send_mail)
 | 
			
		||||
 | 
			
		||||
        # Remove pending deductions to free booked capacities
 | 
			
		||||
        deductions = EcoAccountDeduction.objects.filter(
 | 
			
		||||
            intervention=self
 | 
			
		||||
        )
 | 
			
		||||
        deductions = self.deductions.all()
 | 
			
		||||
        # Remove one by one instead of bulk to trigger EcoAccountDeduction custom delete() logic
 | 
			
		||||
        for deduction in deductions:
 | 
			
		||||
            deduction.delete()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user