Code

Ticket #6850: auth_forms.diff

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

django.contrib.auth.forms patch

Line 
1Index: forms.py
2===================================================================
3--- forms.py    (revision 7341)
4+++ forms.py    (working copy)
5@@ -13,8 +13,8 @@
6     username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\w+$',
7         help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."),
8         error_message = _("This value must contain only letters, numbers and underscores."))
9-    password1 = forms.CharField(label=_("Password"), max_length=60, widget=forms.PasswordInput)
10-    password2 = forms.CharField(label=_("Password confirmation"), max_length=60, widget=forms.PasswordInput)
11+    password1 = forms.CharField(label=_("Password"), max_length=30, widget=forms.PasswordInput)
12+    password2 = forms.CharField(label=_("Password confirmation"), max_length=30, widget=forms.PasswordInput)
13     
14     class Meta:
15         model = User
16@@ -47,8 +47,8 @@
17     Base class for authenticating users. Extend this to get a form that accepts
18     username/password logins.
19     """
20-    username = forms.CharField(max_length=30)
21-    password = forms.CharField(max_length=30, widget=forms.PasswordInput)
22+    username = forms.CharField(label=_("Username"), max_length=30)
23+    password = forms.CharField(label=_("Password"), max_length=30, widget=forms.PasswordInput)
24     
25     def __init__(self, request=None, *args, **kwargs):
26         """
27@@ -88,7 +88,7 @@
28         return self.user_cache
29 
30 class PasswordResetForm(forms.Form):
31-    email = forms.EmailField(max_length=40)
32+    email = forms.EmailField(label=_("E-mail address"))
33     
34     def clean_email(self):
35         """
36@@ -129,9 +129,9 @@
37     """
38     A form that lets a user change his/her password.
39     """
40-    old_password = forms.CharField(max_length=30, widget=forms.PasswordInput)
41-    new_password1 = forms.CharField(max_length=30, widget=forms.PasswordInput)
42-    new_password2 = forms.CharField(max_length=30, widget=forms.PasswordInput)
43+    old_password = forms.CharField(label=_("Old password"), max_length=30, widget=forms.PasswordInput)
44+    new_password1 = forms.CharField(label=_("New password"), max_length=30, widget=forms.PasswordInput)
45+    new_password2 = forms.CharField(label=_("New password confirmation"), max_length=30, widget=forms.PasswordInput)
46     
47     def __init__(self, user, *args, **kwargs):
48         self.user = user
49@@ -164,8 +164,8 @@
50     """
51     A form used to change the password of a user in the admin interface.
52     """
53-    password1 = forms.CharField(max_length=60, widget=forms.PasswordInput)
54-    password2 = forms.CharField(max_length=60, widget=forms.PasswordInput)
55+    password1 = forms.CharField(label=_("Password"), max_length=30, widget=forms.PasswordInput)
56+    password2 = forms.CharField(label=_("Password confirmation"), max_length=30, widget=forms.PasswordInput)
57     
58     def __init__(self, user, *args, **kwargs):
59         self.user = user