Ticket #2731: forms.diff

File forms.diff, 1.9 KB (added by michael.samoylov@…, 18 years ago)
  • contrib/auth/forms.py

     
    8181        try:
    8282            self.user_cache = User.objects.get(email__iexact=new_data)
    8383        except User.DoesNotExist:
    84             raise validators.ValidationError, "That e-mail address doesn't have an associated user acount. Are you sure you've registered?"
     84            raise validators.ValidationError, _("That e-mail address doesn't have an associated user acount. Are you sure you've registered?")
    8585
    8686    def save(self, domain_override=None, email_template_name='registration/password_reset_email.html'):
    8787        "Calculates a new password randomly and sends it to the user"
     
    113113            forms.PasswordField(field_name="old_password", length=30, maxlength=30, is_required=True,
    114114                validator_list=[self.isValidOldPassword]),
    115115            forms.PasswordField(field_name="new_password1", length=30, maxlength=30, is_required=True,
    116                 validator_list=[validators.AlwaysMatchesOtherField('new_password2', "The two 'new password' fields didn't match.")]),
     116                validator_list=[validators.AlwaysMatchesOtherField('new_password2', _("The two 'new password' fields didn't match."))]),
    117117            forms.PasswordField(field_name="new_password2", length=30, maxlength=30, is_required=True),
    118118        )
    119119
    120120    def isValidOldPassword(self, new_data, all_data):
    121121        "Validates that the old_password field is correct."
    122122        if not self.user.check_password(new_data):
    123             raise validators.ValidationError, "Your old password was entered incorrectly. Please enter it again."
     123            raise validators.ValidationError, _("Your old password was entered incorrectly. Please enter it again.")
    124124
    125125    def save(self, new_data):
    126126        "Saves the new password."
Back to Top