Ticket #6850: auth_forms.diff

File auth_forms.diff, 2.9 KB (added by Bela Hausmann <post@…>, 7 years ago)

django.contrib.auth.forms patch

  • forms.py

     
    1313    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\w+$',
    1414        help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."),
    1515        error_message = _("This value must contain only letters, numbers and underscores."))
    16     password1 = forms.CharField(label=_("Password"), max_length=60, widget=forms.PasswordInput)
    17     password2 = forms.CharField(label=_("Password confirmation"), max_length=60, widget=forms.PasswordInput)
     16    password1 = forms.CharField(label=_("Password"), max_length=30, widget=forms.PasswordInput)
     17    password2 = forms.CharField(label=_("Password confirmation"), max_length=30, widget=forms.PasswordInput)
    1818   
    1919    class Meta:
    2020        model = User
     
    4747    Base class for authenticating users. Extend this to get a form that accepts
    4848    username/password logins.
    4949    """
    50     username = forms.CharField(max_length=30)
    51     password = forms.CharField(max_length=30, widget=forms.PasswordInput)
     50    username = forms.CharField(label=_("Username"), max_length=30)
     51    password = forms.CharField(label=_("Password"), max_length=30, widget=forms.PasswordInput)
    5252   
    5353    def __init__(self, request=None, *args, **kwargs):
    5454        """
     
    8888        return self.user_cache
    8989
    9090class PasswordResetForm(forms.Form):
    91     email = forms.EmailField(max_length=40)
     91    email = forms.EmailField(label=_("E-mail address"))
    9292   
    9393    def clean_email(self):
    9494        """
     
    129129    """
    130130    A form that lets a user change his/her password.
    131131    """
    132     old_password = forms.CharField(max_length=30, widget=forms.PasswordInput)
    133     new_password1 = forms.CharField(max_length=30, widget=forms.PasswordInput)
    134     new_password2 = forms.CharField(max_length=30, widget=forms.PasswordInput)
     132    old_password = forms.CharField(label=_("Old password"), max_length=30, widget=forms.PasswordInput)
     133    new_password1 = forms.CharField(label=_("New password"), max_length=30, widget=forms.PasswordInput)
     134    new_password2 = forms.CharField(label=_("New password confirmation"), max_length=30, widget=forms.PasswordInput)
    135135   
    136136    def __init__(self, user, *args, **kwargs):
    137137        self.user = user
     
    164164    """
    165165    A form used to change the password of a user in the admin interface.
    166166    """
    167     password1 = forms.CharField(max_length=60, widget=forms.PasswordInput)
    168     password2 = forms.CharField(max_length=60, widget=forms.PasswordInput)
     167    password1 = forms.CharField(label=_("Password"), max_length=30, widget=forms.PasswordInput)
     168    password2 = forms.CharField(label=_("Password confirmation"), max_length=30, widget=forms.PasswordInput)
    169169   
    170170    def __init__(self, user, *args, **kwargs):
    171171        self.user = user
Back to Top