From 182b5c5b5c4a2703e0713dbcc59e2964b0dd3ac8 Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Mon, 25 Sep 2006 13:53:41 +0000 Subject: [PATCH] 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 --- django/contrib/auth/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py index ad8d423ebf..206cd06e06 100644 --- a/django/contrib/auth/forms.py +++ b/django/contrib/auth/forms.py @@ -81,7 +81,7 @@ class PasswordResetForm(forms.Manipulator): 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 @@ class PasswordChangeForm(forms.Manipulator): 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."