Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed #2731: updated password change form to allow translation

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3828 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 182b5c5b5c4a2703e0713dbcc59e2964b0dd3ac8 1 parent 0d24c93
Georg Bauer authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/contrib/auth/forms.py
View
6 django/contrib/auth/forms.py
@@ -81,7 +81,7 @@ def isValidUserEmail(self, new_data, all_data):
try:
self.user_cache = User.objects.get(email__iexact=new_data)
except User.DoesNotExist:
- raise validators.ValidationError, "That e-mail address doesn't have an associated user acount. Are you sure you've registered?"
+ raise validators.ValidationError, _("That e-mail address doesn't have an associated user acount. Are you sure you've registered?")
def save(self, domain_override=None, email_template_name='registration/password_reset_email.html'):
"Calculates a new password randomly and sends it to the user"
@@ -113,14 +113,14 @@ def __init__(self, user):
forms.PasswordField(field_name="old_password", length=30, maxlength=30, is_required=True,
validator_list=[self.isValidOldPassword]),
forms.PasswordField(field_name="new_password1", length=30, maxlength=30, is_required=True,
- validator_list=[validators.AlwaysMatchesOtherField('new_password2', "The two 'new password' fields didn't match.")]),
+ validator_list=[validators.AlwaysMatchesOtherField('new_password2', _("The two 'new password' fields didn't match."))]),
forms.PasswordField(field_name="new_password2", length=30, maxlength=30, is_required=True),
)
def isValidOldPassword(self, new_data, all_data):
"Validates that the old_password field is correct."
if not self.user.check_password(new_data):
- raise validators.ValidationError, "Your old password was entered incorrectly. Please enter it again."
+ raise validators.ValidationError, _("Your old password was entered incorrectly. Please enter it again.")
def save(self, new_data):
"Saves the new password."
Please sign in to comment.
Something went wrong with that request. Please try again.