mirror of
https://github.com/ae-utbm/sith.git
synced 2025-04-16 02:50:22 +00:00
Merge pull request #1074 from ae-utbm/import-error
Fix cyclic import error on core/views/user.py
This commit is contained in:
commit
53038a365f
@ -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()(
|
||||
|
Loading…
x
Reference in New Issue
Block a user