Added condition to hosting form to show message for account that have not yet been validated after account creation

This commit is contained in:
M.Ravi 2017-06-11 05:14:20 +05:30
parent b8463360b5
commit 707d8e7370

View file

@ -24,6 +24,8 @@ class HostingUserLoginForm(forms.Form):
is_auth = authenticate(email=email, password=password)
if not is_auth:
raise forms.ValidationError("Your username and/or password were incorrect.")
elif is_auth.validated == 0:
raise forms.ValidationError(_("Your account is not activated yet."))
return self.cleaned_data
def clean_email(self):