mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 01:12:08 +01:00 
			
		
		
		
	Signals used to ignore _no_signal
This commit is contained in:
		@@ -16,7 +16,8 @@ def save_user_profile(instance, created, raw, **_kwargs):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def update_wei_registration_fee_on_membership_creation(sender, instance, created, **kwargs):
 | 
			
		||||
    if created:
 | 
			
		||||
    if not hasattr(instance, "_no_signal") and created:
 | 
			
		||||
        print('update_wei_registration_fee_on_membership_creation')
 | 
			
		||||
        from wei.models import WEIRegistration
 | 
			
		||||
        if instance.club.id == 1 or instance.club.id == 2:
 | 
			
		||||
            registrations = WEIRegistration.objects.filter(
 | 
			
		||||
@@ -24,14 +25,16 @@ def update_wei_registration_fee_on_membership_creation(sender, instance, created
 | 
			
		||||
                wei__year=instance.date_start.year,
 | 
			
		||||
            )
 | 
			
		||||
            for r in registrations:
 | 
			
		||||
                r._force_save = True
 | 
			
		||||
                r.save()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def update_wei_registration_fee_on_club_change(sender, instance, **kwargs):
 | 
			
		||||
    from wei.models import WEIRegistration
 | 
			
		||||
    if instance.id == 1 or instance.id == 2:
 | 
			
		||||
    if not hasattr(instance, "_no_signal") and (instance.id == 1 or instance.id == 2):
 | 
			
		||||
        registrations = WEIRegistration.objects.filter(
 | 
			
		||||
            wei__year=instance.membership_start.year,
 | 
			
		||||
        )
 | 
			
		||||
        for r in registrations:
 | 
			
		||||
            r._force_save = True
 | 
			
		||||
            r.save()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user