1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

Fixed login error when email have space character

This commit is contained in:
zhengxie
2014-01-03 11:11:05 +08:00
parent 4eafa5fb56
commit 5c73b88213

View File

@@ -80,7 +80,7 @@ def login(request, template_name='registration/login.html',
# password is valid, log user in
return log_user_in(request, form.get_user(), redirect_to)
else:
username = request.REQUEST.get('username', '')
username = request.REQUEST.get('username', '').strip()
failed_attempt = cache.get(LOGIN_ATTEMPT_PREFIX+username, 1)
if failed_attempt >= settings.LOGIN_ATTEMPT_LIMIT:
form = CaptchaAuthenticationForm()