diff --git a/kfet/forms.py b/kfet/forms.py index 03fcce3a..522f20de 100644 --- a/kfet/forms.py +++ b/kfet/forms.py @@ -75,14 +75,19 @@ class AccountRestrictForm(AccountForm): class Meta(AccountForm.Meta): fields = ['is_frozen'] + class AccountPwdForm(forms.Form): pwd1 = forms.CharField( - label="Mot de passe K-Fêt", - help_text="Le mot de passe doit contenir au moins huit caractères", - widget=forms.PasswordInput) + label="Mot de passe K-Fêt", + required=False, + help_text="Le mot de passe doit contenir au moins huit caractères", + widget=forms.PasswordInput, + ) pwd2 = forms.CharField( - label="Confirmer le mot de passe", - widget=forms.PasswordInput) + label="Confirmer le mot de passe", + required=False, + widget=forms.PasswordInput, + ) def clean(self): pwd1 = self.cleaned_data.get('pwd1', '') @@ -93,6 +98,7 @@ class AccountPwdForm(forms.Form): raise ValidationError("Les mots de passes sont différents") super().clean() + class CofForm(forms.ModelForm): def clean_is_cof(self): instance = getattr(self, 'instance', None)