1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-24 18:22:24 +00:00

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

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