mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
Pre-fetch forms for student card
This commit is contained in:
@ -71,6 +71,7 @@ from core.views.forms import (
|
||||
UserProfileForm,
|
||||
)
|
||||
from counter.models import Refilling, Selling
|
||||
from counter.views.student_card import StudentCardFormView
|
||||
from eboutic.models import Invoice
|
||||
from subscription.models import Subscription
|
||||
from trombi.views import UserTrombiForm
|
||||
@ -575,6 +576,10 @@ class UserPreferencesView(UserTabsMixin, CanEditMixin, UpdateView):
|
||||
hasattr(self.object, "trombi_user") and self.request.user.trombi_user.trombi
|
||||
):
|
||||
kwargs["trombi_form"] = UserTrombiForm()
|
||||
if hasattr(self.object, "customer"):
|
||||
kwargs["student_card"] = StudentCardFormView.get_template_data(
|
||||
self.request, self.object.customer
|
||||
).as_dict()
|
||||
return kwargs
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user