diff --git a/apps/member/signals.py b/apps/member/signals.py index f07c8896..839f0dc9 100644 --- a/apps/member/signals.py +++ b/apps/member/signals.py @@ -1,6 +1,8 @@ # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay # SPDX-License-Identifier: GPL-3.0-or-later +from django.conf import settings + def save_user_profile(instance, created, raw, **_kwargs): """ @@ -16,7 +18,7 @@ def save_user_profile(instance, created, raw, **_kwargs): def update_wei_registration_fee_on_membership_creation(sender, instance, created, **kwargs): - if not hasattr(instance, "_no_signal") and created: + if not hasattr(instance, "_no_signal") and 'wei' in settings.INSTALLED_APPS and created: from wei.models import WEIRegistration if instance.club.id == 1 or instance.club.id == 2: registrations = WEIRegistration.objects.filter( @@ -29,8 +31,8 @@ def update_wei_registration_fee_on_membership_creation(sender, instance, created def update_wei_registration_fee_on_club_change(sender, instance, **kwargs): - from wei.models import WEIRegistration - if not hasattr(instance, "_no_signal") and (instance.id == 1 or instance.id == 2): + if not hasattr(instance, "_no_signal") and 'wei' in settings.INSTALLED_APPS and (instance.id == 1 or instance.id == 2): + from wei.models import WEIRegistration registrations = WEIRegistration.objects.filter( wei__year=instance.membership_start.year, ) diff --git a/apps/member/templates/member/includes/profile_info.html b/apps/member/templates/member/includes/profile_info.html index 3ea525d5..579fac25 100644 --- a/apps/member/templates/member/includes/profile_info.html +++ b/apps/member/templates/member/includes/profile_info.html @@ -7,16 +7,19 @@