From d2fe0f1fab8a9ff1856c194bbfbd0e8163e2be8f Mon Sep 17 00:00:00 2001 From: Sli Date: Thu, 10 Apr 2025 11:49:59 +0200 Subject: [PATCH] Fix cyclic import error on core/views/user.py --- core/views/user.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/views/user.py b/core/views/user.py index cd8fd55b..93b64d3b 100644 --- a/core/views/user.py +++ b/core/views/user.py @@ -66,7 +66,6 @@ from core.views.forms import ( ) from core.views.mixins import QuickNotifMixin, TabedViewMixin, UseFragmentsMixin from counter.models import Counter, Refilling, Selling -from counter.views.student_card import StudentCardFormFragment from eboutic.models import Invoice from subscription.models import Subscription from trombi.views import UserTrombiForm @@ -529,6 +528,9 @@ class UserPreferencesView(UserTabsMixin, UseFragmentsMixin, CanEditMixin, Update return kwargs def get_fragment_context_data(self) -> dict[str, SafeString]: + # Avoid cyclic import error + from counter.views.student_card import StudentCardFormFragment + res = super().get_fragment_context_data() if hasattr(self.object, "customer"): res["student_card_fragment"] = StudentCardFormFragment.as_fragment()(