Skip to content

Commit

Permalink
Merge pull request openedx#488 from caseylitton/story_improve_account…
Browse files Browse the repository at this point in the history
…_lockout_messaging_typos

Fix typos in user log-in lockout message
  • Loading branch information
caesar2164 authored Aug 3, 2016
2 parents d40b3c7 + c4180d7 commit f641351
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cms/djangoapps/contentstore/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ def test_excessive_login_failures(self):
self.assertIn(
(
"This account has been temporarily locked due to excessive login failures. "
"Try again in {minutes} minute(s). For security reasons, "
"reseting the password will NOT lift the lockout. Please wait for {minutes} minute(s)."
"Try again in {minutes} minutes. For security reasons, "
"resetting the password will NOT lift the lockout. Please wait for {minutes} minutes."
).format(
minutes=LOGIN_LOCKOUT_PERIOD_PLUS_FIVE_MINUTES,
),
Expand Down
12 changes: 8 additions & 4 deletions common/djangoapps/student/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from django.http import (HttpResponse, HttpResponseBadRequest, HttpResponseForbidden,
HttpResponseServerError, Http404)
from django.shortcuts import redirect
from django.utils.translation import ungettext
from django.utils.translation import ungettext, ngettext
from django.utils.http import base36_to_int
from django.utils.translation import ugettext as _, get_language
from django.views.decorators.csrf import csrf_exempt, ensure_csrf_cookie
Expand Down Expand Up @@ -1288,10 +1288,14 @@ def login_user(request, error=""): # pylint: disable=too-many-statements,unused
if LoginFailures.is_user_locked_out(user_found_by_email_lookup):
return JsonResponse({
"success": False,
"value": _(
"value": ngettext(
"This account has been temporarily locked due to excessive login failures. "
"Try again in {minutes} minute(s). For security reasons, "
"reseting the password will NOT lift the lockout. Please wait for {minutes} minute(s).").format(
"Try again in {minutes} minute. For security reasons, "
"resetting the password will NOT lift the lockout. Please wait for {minutes} minute.",
"This account has been temporarily locked due to excessive login failures. "
"Try again in {minutes} minutes. For security reasons, "
"resetting the password will NOT lift the lockout. Please wait for {minutes} minutes.",
LOGIN_LOCKOUT_PERIOD_PLUS_FIVE_MINUTES).format(
minutes=LOGIN_LOCKOUT_PERIOD_PLUS_FIVE_MINUTES,),
}) # TODO: this should be status code 429 # pylint: disable=fixme

Expand Down

0 comments on commit f641351

Please sign in to comment.