diff --git a/apps/member/forms.py b/apps/member/forms.py index 66844cf4..abb35cd9 100644 --- a/apps/member/forms.py +++ b/apps/member/forms.py @@ -14,6 +14,11 @@ from crispy_forms.layout import Layout class SignUpForm(UserCreationForm): + def __init__(self,*args,**kwargs): + super().__init__(*args,**kwargs) + self.fields['username'].widget.attrs.pop("autofocus", None) + self.fields['first_name'].widget.attrs.update({"autofocus":"autofocus"}) + class Meta: model = User fields = ['first_name', 'last_name', 'username', 'email'] diff --git a/apps/member/views.py b/apps/member/views.py index 6f982c64..6d82a6cc 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -114,12 +114,13 @@ class UserDetailView(LoginRequiredMixin, DetailView): """ Affiche les informations sur un utilisateur, sa note, ses clubs... """ - model = Profile - context_object_name = "profile" + model = User + context_object_name = "user_object" + template_name = "member/profile_detail.html" def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - user = context['profile'].user + user = context['user_object'] history_list = \ Transaction.objects.all().filter(Q(source=user.note) | Q(destination=user.note)) context['history_list'] = HistoryTable(history_list) diff --git a/templates/base.html b/templates/base.html index 4b5f9872..477ebdaf 100644 --- a/templates/base.html +++ b/templates/base.html @@ -87,7 +87,7 @@ SPDX-License-Identifier: GPL-3.0-or-later