1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-28 11:41:18 +00:00

Show account freeze error

This commit is contained in:
zhengxie 2016-04-23 14:24:48 +08:00
parent f57a435298
commit 2cfafb22e9
No known key found for this signature in database
GPG Key ID: 652D4F38038852F0
2 changed files with 5 additions and 2 deletions

View File

@ -162,6 +162,7 @@ def login(request, template_name='registration/login.html',
user.freeze_user(notify_admins=True) user.freeze_user(notify_admins=True)
except User.DoesNotExist: except User.DoesNotExist:
pass pass
form.errors['freeze_account'] = _('This account has been frozen due to too many failed login attempts.')
else: else:
# log user in if password is valid otherwise show captcha # log user in if password is valid otherwise show captcha
form = CaptchaAuthenticationForm(data=request.POST) form = CaptchaAuthenticationForm(data=request.POST)

View File

@ -20,9 +20,11 @@
<input type="hidden" name="next" value="{% if next %}{{ next|escape }}{% else %}{{ SITE_ROOT }}{% endif %}" /> <input type="hidden" name="next" value="{% if next %}{{ next|escape }}{% else %}{{ SITE_ROOT }}{% endif %}" />
{% if form.errors %} {% if form.errors %}
{% if form.captcha.errors %} {% if form.captcha.errors %}
<p class="error">{{ form.captcha.errors}}</p> <p class="error">{{ form.captcha.errors}}</p>
{% elif form.errors.freeze_account %}
<p class="error">{{ form.errors.freeze_account }}</p>
{% else %} {% else %}
<p class="error">{% trans "Incorrect email or password" %}</p> <p class="error">{% trans "Incorrect email or password" %}</p>
{% endif %} {% endif %}
{% else %} {% else %}
<p class="error hide"></p> <p class="error hide"></p>