Ticket #2816: auth-form-i18n2.diff

File auth-form-i18n2.diff, 1.1 KB (added by Ramiro Morales, 18 years ago)

a cleaner version of the patch

  • contrib/auth/forms.py

    old new  
    1313                validator_list=[validators.isAlphaNumeric, self.isValidUsername]),
    1414            forms.PasswordField(field_name='password1', length=30, maxlength=60, is_required=True),
    1515            forms.PasswordField(field_name='password2', length=30, maxlength=60, is_required=True,
    16                 validator_list=[validators.AlwaysMatchesOtherField('password1', "The two password fields didn't match.")]),
     16                validator_list=[validators.AlwaysMatchesOtherField('password1', _("The two password fields didn't match."))]),
    1717        )
    1818
    1919    def isValidUsername(self, field_data, all_data):
     
    2121            User.objects.get(username=field_data)
    2222        except User.DoesNotExist:
    2323            return
    24         raise validators.ValidationError, 'A user with that username already exists.'
     24        raise validators.ValidationError, _("A user with that username already exists.")
    2525
    2626    def save(self, new_data):
    2727        "Creates the user."
Back to Top