Ticket #16709: username_of_128chars.diff

File username_of_128chars.diff, 2.7 KB (added by wim@…, 13 years ago)

patch for making usernames 128 characters

  • models.py

     
    181181
    182182    Username and password are required. Other fields are optional.
    183183    """
    184     username = models.CharField(_('username'), max_length=30, unique=True, help_text=_("Required. 30 characters or fewer. Letters, numbers and @/./+/-/_ characters"))
     184    username = models.CharField(_('username'), max_length=128, unique=True, help_text=_("Required. 128 characters or fewer. Letters, numbers and @/./+/-/_ characters"))
    185185    first_name = models.CharField(_('first name'), max_length=30, blank=True)
    186186    last_name = models.CharField(_('last name'), max_length=30, blank=True)
    187187    email = models.EmailField(_('e-mail address'), blank=True)
  • forms.py

     
    1515    """
    1616    A form that creates a user, with no privileges, from the given username and password.
    1717    """
    18     username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
    19         help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
     18    username = forms.RegexField(label=_("Username"), max_length=128, regex=r'^[\w.@+-]+$',
     19        help_text = _("Required. 128 characters or fewer. Letters, digits and @/./+/-/_ only."),
    2020        error_messages = {'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
    2121    password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
    2222    password2 = forms.CharField(label=_("Password confirmation"), widget=forms.PasswordInput,
     
    4949        return user
    5050
    5151class UserChangeForm(forms.ModelForm):
    52     username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
    53         help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
     52    username = forms.RegexField(label=_("Username"), max_length=128, regex=r'^[\w.@+-]+$',
     53        help_text = _("Required. 128 characters or fewer. Letters, digits and @/./+/-/_ only."),
    5454        error_messages = {'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
    5555
    5656    class Meta:
     
    6767    Base class for authenticating users. Extend this to get a form that accepts
    6868    username/password logins.
    6969    """
    70     username = forms.CharField(label=_("Username"), max_length=30)
     70    username = forms.CharField(label=_("Username"), max_length=128)
    7171    password = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
    7272
    7373    def __init__(self, request=None, *args, **kwargs):
Back to Top