Commit 0c69e103 authored by Valentin Samir's avatar Valentin Samir

demande un mot de passe sql d'au moins 8 caractères

parent 7be53cfa
......@@ -27,6 +27,12 @@ class SqlPasswordForm(forms.Form):
required=True
)
def clean_password(self):
if len(self.cleaned_data["password"]) < 8:
raise forms.ValidationError("Le mot de passe doit faire au moins 8 caractères")
return self.cleaned_data["password"]
def clean(self):
if self.cleaned_data.get("password") != self.cleaned_data.get("password_confirmation"):
raise forms.ValidationError("Les mots de passes ne sont pas identique")
if "password" in self.cleaned_data:
if self.cleaned_data["password"] != self.cleaned_data.get("password_confirmation"):
raise forms.ValidationError("Les mots de passes ne sont pas identique")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment