Ajout de la gestion de l'activation des comptes utilisateur par e-mail, des validations pour les pseudos existants, et configuration par défaut de l'e-mail backend.
This commit is contained in:
parent
ca0211e841
commit
fc4939577a
5 changed files with 74 additions and 4 deletions
|
|
@ -27,7 +27,15 @@ class UserRegistrationForm(forms.Form):
|
|||
password2 = cleaned_data.get("password2")
|
||||
|
||||
if password1 and password2 and password1 != password2:
|
||||
raise forms.ValidationError("Passwords do not match")
|
||||
raise forms.ValidationError("Les mots de passe ne correspondent pas.")
|
||||
|
||||
return cleaned_data
|
||||
|
||||
def clean_username(self):
|
||||
username = self.cleaned_data.get('username')
|
||||
if username and User.objects.filter(username__iexact=username).exists():
|
||||
raise forms.ValidationError("Ce pseudo est déjà pris. Veuillez en choisir un autre.")
|
||||
return username
|
||||
|
||||
class UserLoginForm(forms.Form):
|
||||
username = forms.CharField(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue