fix user creation bug
This commit is contained in:
parent
7d64313f4d
commit
e8ab948bc9
|
@ -45,6 +45,7 @@ class CreateUserForm(forms.ModelForm):
|
||||||
email = self.cleaned_data.get('email')
|
email = self.cleaned_data.get('email')
|
||||||
if email and User.objects.filter(email=email).exists():
|
if email and User.objects.filter(email=email).exists():
|
||||||
raise forms.ValidationError(_('A user with that email already exists.'))
|
raise forms.ValidationError(_('A user with that email already exists.'))
|
||||||
|
return email
|
||||||
|
|
||||||
def save(self, commit=True):
|
def save(self, commit=True):
|
||||||
user = super().save(commit=False)
|
user = super().save(commit=False)
|
||||||
|
|
Loading…
Reference in New Issue