Merge branch 'aureplop/194-kfet_edit-account' into 'master'

kfet -- As a kfet staff, remove the requirement to…

Closes #194

See merge request cof-geek/gestioCOF!303
This commit is contained in:
Ludovic Stephan 2018-06-16 17:13:17 +02:00
commit e515a55956

View file

@ -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)