forked from DGNum/gestioCOF
kfet -- As a kfet staff, remove the requirement to…
provide a password in the edit view of an account.
This commit is contained in:
parent
68e71317cb
commit
645c01ebd1
|
@ -75,14 +75,19 @@ class AccountRestrictForm(AccountForm):
|
||||||
class Meta(AccountForm.Meta):
|
class Meta(AccountForm.Meta):
|
||||||
fields = ['is_frozen']
|
fields = ['is_frozen']
|
||||||
|
|
||||||
|
|
||||||
class AccountPwdForm(forms.Form):
|
class AccountPwdForm(forms.Form):
|
||||||
pwd1 = forms.CharField(
|
pwd1 = forms.CharField(
|
||||||
label="Mot de passe K-Fêt",
|
label="Mot de passe K-Fêt",
|
||||||
|
required=False,
|
||||||
help_text="Le mot de passe doit contenir au moins huit caractères",
|
help_text="Le mot de passe doit contenir au moins huit caractères",
|
||||||
widget=forms.PasswordInput)
|
widget=forms.PasswordInput,
|
||||||
|
)
|
||||||
pwd2 = forms.CharField(
|
pwd2 = forms.CharField(
|
||||||
label="Confirmer le mot de passe",
|
label="Confirmer le mot de passe",
|
||||||
widget=forms.PasswordInput)
|
required=False,
|
||||||
|
widget=forms.PasswordInput,
|
||||||
|
)
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
pwd1 = self.cleaned_data.get('pwd1', '')
|
pwd1 = self.cleaned_data.get('pwd1', '')
|
||||||
|
@ -93,6 +98,7 @@ class AccountPwdForm(forms.Form):
|
||||||
raise ValidationError("Les mots de passes sont différents")
|
raise ValidationError("Les mots de passes sont différents")
|
||||||
super().clean()
|
super().clean()
|
||||||
|
|
||||||
|
|
||||||
class CofForm(forms.ModelForm):
|
class CofForm(forms.ModelForm):
|
||||||
def clean_is_cof(self):
|
def clean_is_cof(self):
|
||||||
instance = getattr(self, 'instance', None)
|
instance = getattr(self, 'instance', None)
|
||||||
|
|
Loading…
Reference in a new issue