From 3e40858e25ce7968dc16e11564f86df24268779f Mon Sep 17 00:00:00 2001 From: Marcel Wrzos-Kaminski Date: Sun, 22 Jan 2023 19:32:21 +0000 Subject: [PATCH] make payment price sync on order delete --- apps/webshop/signals.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/webshop/signals.py b/apps/webshop/signals.py index 637c64ae7..21e24fa16 100644 --- a/apps/webshop/signals.py +++ b/apps/webshop/signals.py @@ -1,6 +1,6 @@ import logging -from django.db.models.signals import post_save +from django.db.models.signals import post_delete, post_save from django.dispatch import receiver from apps.payment.models import Payment, PaymentPrice @@ -10,6 +10,7 @@ logger = logging.getLogger(__name__) +@receiver(post_delete, sender=Order) @receiver(post_save, sender=Order) @disable_for_loaddata def sync_order_line_subtotal_to_payment_price(sender, instance: Order, **kwargs):