# Implements #332 #323

Merged
mpeltriaux merged 2 commits from 332_Drop_deductions_of_deleted_intervention into master 2023-03-30 15:11:43 +02:00
Showing only changes of commit 8a84df0fcd - Show all commits

View File

@ -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()