~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to django/contrib/auth/forms.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2010-05-21 07:52:55 UTC
  • mfrom: (1.3.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20100521075255-ii78v1dyfmyu3uzx
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
    """
12
12
    A form that creates a user, with no privileges, from the given username and password.
13
13
    """
14
 
    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\w+$',
15
 
        help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."),
16
 
        error_message = _("This value must contain only letters, numbers and underscores."))
 
14
    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
 
15
        help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
 
16
        error_messages = {'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
17
17
    password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
18
 
    password2 = forms.CharField(label=_("Password confirmation"), widget=forms.PasswordInput)
 
18
    password2 = forms.CharField(label=_("Password confirmation"), widget=forms.PasswordInput,
 
19
        help_text = _("Enter the same password as above, for verification."))
19
20
 
20
21
    class Meta:
21
22
        model = User
44
45
        return user
45
46
 
46
47
class UserChangeForm(forms.ModelForm):
47
 
    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\w+$',
48
 
        help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."),
49
 
        error_message = _("This value must contain only letters, numbers and underscores."))
50
 
    
 
48
    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
 
49
        help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
 
50
        error_messages = {'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
 
51
 
51
52
    class Meta:
52
53
        model = User
53
54