fix user creation bug

This commit is contained in:
Élie Bouttier 2017-07-31 22:44:25 +02:00
parent 7d64313f4d
commit e8ab948bc9
1 changed files with 1 additions and 0 deletions

View File

@ -45,6 +45,7 @@ class CreateUserForm(forms.ModelForm):
email = self.cleaned_data.get('email')
if email and User.objects.filter(email=email).exists():
raise forms.ValidationError(_('A user with that email already exists.'))
return email
def save(self, commit=True):
user = super().save(commit=False)