Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

newforms-admin: Fixed #6774, #7068 -- Use ugettext_lazy instead of ug…

…ettext in django/contrib/auth/forms.py. Marked a few strings for translation in the forms.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7449 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7b7f4bdee251459760184e879be8faeca719ab01 1 parent 0f5ffbf
@brosner brosner authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 django/contrib/auth/forms.py
View
18 django/contrib/auth/forms.py
@@ -4,7 +4,7 @@
from django.template import Context, loader
from django.core import validators
from django import newforms as forms
-from django.utils.translation import ugettext as _
+from django.utils.translation import ugettext_lazy as _
class UserCreationForm(forms.ModelForm):
"""
@@ -47,8 +47,8 @@ class AuthenticationForm(forms.Form):
Base class for authenticating users. Extend this to get a form that accepts
username/password logins.
"""
- username = forms.CharField(max_length=30)
- password = forms.CharField(max_length=30, widget=forms.PasswordInput)
+ username = forms.CharField(label=_("Username"), max_length=30)
+ password = forms.CharField(label=_("Password"), max_length=30, widget=forms.PasswordInput)
def __init__(self, request=None, *args, **kwargs):
"""
@@ -88,7 +88,7 @@ def get_user(self):
return self.user_cache
class PasswordResetForm(forms.Form):
- email = forms.EmailField(max_length=40)
+ email = forms.EmailField(label=_("Email"), max_length=40)
def clean_email(self):
"""
@@ -129,9 +129,9 @@ class PasswordChangeForm(forms.Form):
"""
A form that lets a user change his/her password.
"""
- old_password = forms.CharField(max_length=30, widget=forms.PasswordInput)
- new_password1 = forms.CharField(max_length=30, widget=forms.PasswordInput)
- new_password2 = forms.CharField(max_length=30, widget=forms.PasswordInput)
+ old_password = forms.CharField(label=_("Old password"), max_length=30, widget=forms.PasswordInput)
+ new_password1 = forms.CharField(label=_("New password"), max_length=30, widget=forms.PasswordInput)
+ new_password2 = forms.CharField(label=_("New password confirmation"), max_length=30, widget=forms.PasswordInput)
def __init__(self, user, *args, **kwargs):
self.user = user
@@ -164,8 +164,8 @@ class AdminPasswordChangeForm(forms.Form):
"""
A form used to change the password of a user in the admin interface.
"""
- password1 = forms.CharField(max_length=60, widget=forms.PasswordInput)
- password2 = forms.CharField(max_length=60, widget=forms.PasswordInput)
+ password1 = forms.CharField(label=_("Password"), max_length=60, widget=forms.PasswordInput)
+ password2 = forms.CharField(label=_("Password (again)"), max_length=60, widget=forms.PasswordInput)
def __init__(self, user, *args, **kwargs):
self.user = user

0 comments on commit 7b7f4bd

Please sign in to comment.
Something went wrong with that request. Please try again.