diff --git a/seahub/auth/forms.py b/seahub/auth/forms.py index af81db1e68..8680b3b7b7 100644 --- a/seahub/auth/forms.py +++ b/seahub/auth/forms.py @@ -61,6 +61,7 @@ class AuthenticationForm(forms.Form): if self.user_cache is None: raise forms.ValidationError(_("Please enter a correct email/username and password. Note that both fields are case-sensitive.")) elif not self.user_cache.is_active: + self.errors['inactive'] = _("This account is inactive.") raise forms.ValidationError(_("This account is inactive.")) # TODO: determine whether this should move to its own method. diff --git a/seahub/templates/registration/login.html b/seahub/templates/registration/login.html index 2b5bfbd5bb..3f8969ef6f 100644 --- a/seahub/templates/registration/login.html +++ b/seahub/templates/registration/login.html @@ -23,6 +23,8 @@

{{ form.captcha.errors}}

{% elif form.errors.freeze_account %}

{{ form.errors.freeze_account }}

+ {% elif form.errors.inactive %} +

{{ form.errors.inactive }}

{% else %}

{% trans "Incorrect email or password" %}

{% endif %}