Ticket #2731: forms.diff
File forms.diff, 1.9 KB (added by , 18 years ago) |
---|
-
contrib/auth/forms.py
81 81 try: 82 82 self.user_cache = User.objects.get(email__iexact=new_data) 83 83 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?") 85 85 86 86 def save(self, domain_override=None, email_template_name='registration/password_reset_email.html'): 87 87 "Calculates a new password randomly and sends it to the user" … … 113 113 forms.PasswordField(field_name="old_password", length=30, maxlength=30, is_required=True, 114 114 validator_list=[self.isValidOldPassword]), 115 115 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."))]), 117 117 forms.PasswordField(field_name="new_password2", length=30, maxlength=30, is_required=True), 118 118 ) 119 119 120 120 def isValidOldPassword(self, new_data, all_data): 121 121 "Validates that the old_password field is correct." 122 122 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.") 124 124 125 125 def save(self, new_data): 126 126 "Saves the new password."