diff --git a/seahub/auth/views.py b/seahub/auth/views.py index c2d5c78b6f..5ab1f1499d 100644 --- a/seahub/auth/views.py +++ b/seahub/auth/views.py @@ -162,6 +162,7 @@ def login(request, template_name='registration/login.html', user.freeze_user(notify_admins=True) except User.DoesNotExist: pass + form.errors['freeze_account'] = _('This account has been frozen due to too many failed login attempts.') else: # log user in if password is valid otherwise show captcha form = CaptchaAuthenticationForm(data=request.POST) diff --git a/seahub/templates/registration/login.html b/seahub/templates/registration/login.html index be4b50e9ac..f2b560253d 100644 --- a/seahub/templates/registration/login.html +++ b/seahub/templates/registration/login.html @@ -20,9 +20,11 @@ {% if form.errors %} {% if form.captcha.errors %} -
{{ form.captcha.errors}}
+{{ form.captcha.errors}}
+ {% elif form.errors.freeze_account %} +{{ form.errors.freeze_account }}
{% else %} -{% trans "Incorrect email or password" %}
+{% trans "Incorrect email or password" %}
{% endif %} {% else %}