mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 08:22:10 +01: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:
		@@ -49,5 +49,5 @@ def update_payment_amount(instance, **_):
 | 
				
			|||||||
    """
 | 
					    """
 | 
				
			||||||
    if instance.type == 'free' or instance.type == 'scholarship':
 | 
					    if instance.type == 'free' or instance.type == 'scholarship':
 | 
				
			||||||
        instance.amount = 0
 | 
					        instance.amount = 0
 | 
				
			||||||
    elif instance.pk:
 | 
					    elif instance.pk and instance.registrations.exists():
 | 
				
			||||||
        instance.amount = instance.registrations.count() * instance.tournament.price
 | 
					        instance.amount = instance.registrations.count() * instance.tournament.price
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user