|
|
|
@ -140,6 +140,11 @@ class CustomPasswordResetForm(PasswordResetForm): |
|
|
|
send_mail(subject, message, None, [user.email]) |
|
|
|
send_mail(subject, message, None, [user.email]) |
|
|
|
|
|
|
|
|
|
|
|
class ProfileUpdateForm(forms.ModelForm): |
|
|
|
class ProfileUpdateForm(forms.ModelForm): |
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
|
|
|
|
|
super().__init__(*args, **kwargs) |
|
|
|
|
|
|
|
# Remove autofocus from the 'username' field |
|
|
|
|
|
|
|
self.fields['username'].widget.attrs.pop("autofocus", None) |
|
|
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
class Meta: |
|
|
|
model = CustomUser |
|
|
|
model = CustomUser |
|
|
|
fields = ['first_name', 'last_name', 'licence_id', 'username', 'email', 'phone'] |
|
|
|
fields = ['first_name', 'last_name', 'licence_id', 'username', 'email', 'phone'] |
|
|
|
@ -151,3 +156,12 @@ class ProfileUpdateForm(forms.ModelForm): |
|
|
|
'last_name': 'Nom de famille', |
|
|
|
'last_name': 'Nom de famille', |
|
|
|
'licence_id': 'Numéro de licence', |
|
|
|
'licence_id': 'Numéro de licence', |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from django.contrib.auth.forms import PasswordChangeForm |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CustomPasswordChangeForm(PasswordChangeForm): |
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
|
|
|
|
|
super().__init__(*args, **kwargs) |
|
|
|
|
|
|
|
# Remove autofocus from all fields in the PasswordChangeForm |
|
|
|
|
|
|
|
for field in self.fields.values(): |
|
|
|
|
|
|
|
field.widget.attrs.pop("autofocus", None) |
|
|
|
|