1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 21:07:17 +00:00

Merge pull request #1473 from haiwen/inactive

show detailed error msg when user login failed
This commit is contained in:
xiez
2017-02-08 11:24:18 +08:00
committed by GitHub
2 changed files with 3 additions and 0 deletions

View File

@@ -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.

View File

@@ -23,6 +23,8 @@
<p class="error">{{ form.captcha.errors}}</p>
{% elif form.errors.freeze_account %}
<p class="error">{{ form.errors.freeze_account }}</p>
{% elif form.errors.inactive %}
<p class="error">{{ form.errors.inactive }}</p>
{% else %}
<p class="error">{% trans "Incorrect email or password" %}</p>
{% endif %}