From 645c01ebd19f883e35e24cf149d41d685669f50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Sat, 16 Jun 2018 12:33:51 +0200 Subject: [PATCH] =?UTF-8?q?kfet=20--=20As=20a=20kfet=20staff,=20remove=20t?= =?UTF-8?q?he=20requirement=20to=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit provide a password in the edit view of an account. --- kfet/forms.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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)