Don't update payment amount if there isn't anyone

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-02-29 23:00:35 +01:00
parent 1684c079e3
commit 6b7b802d14
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 1 additions and 1 deletions

View File

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