From 6b7b802d1403e629efb5033127728b6dbaf569e4 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Thu, 29 Feb 2024 23:00:35 +0100 Subject: [PATCH] Don't update payment amount if there isn't anyone Signed-off-by: Emmy D'Anello --- registration/signals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registration/signals.py b/registration/signals.py index 55a05cd..d282586 100644 --- a/registration/signals.py +++ b/registration/signals.py @@ -49,5 +49,5 @@ def update_payment_amount(instance, **_): """ if instance.type == 'free' or instance.type == 'scholarship': instance.amount = 0 - elif instance.pk: + elif instance.pk and instance.registrations.exists(): instance.amount = instance.registrations.count() * instance.tournament.price