Return if the form already contains error

This commit is contained in:
M.Ravi 2017-10-14 12:52:18 +02:00
parent e7882c0dec
commit ed05411dac

View file

@ -29,6 +29,8 @@ class HostingUserLoginForm(forms.Form):
def clean(self):
email = self.cleaned_data.get('email')
password = self.cleaned_data.get('password')
if self.errors:
return self.cleaned_data
is_auth = authenticate(email=email, password=password)
if not is_auth:
raise forms.ValidationError(