Parcourir la source

Disable invoice/payment change handling for loaddata

Alexandre Aubin il y a 7 ans
Parent
commit
3b8cf40c18
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      coin/billing/models.py

+ 3 - 0
coin/billing/models.py

@@ -539,6 +539,7 @@ def compute_balance(invoices, payments):
 
 
 @receiver(post_save, sender=Payment)
+@disable_for_loaddata
 def payment_changed(sender, instance, created, **kwargs):
 
     if created:
@@ -557,7 +558,9 @@ def payment_changed(sender, instance, created, **kwargs):
     and (instance.member is not None):
         update_accounting_for_member(instance.member)
 
+
 @receiver(post_save, sender=Invoice)
+@disable_for_loaddata
 def invoice_changed(sender, instance, created, **kwargs):
 
     if created: