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:
parent
1684c079e3
commit
6b7b802d14
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue