#13000: Deprecated code in admin forms triggers string translation too soon
----------------------------------+-----------------------------------------
 Reporter:  lgs                   |       Owner:  nobody    
   Status:  new                   |   Milestone:  1.2       
Component:  django.contrib.admin  |     Version:  SVN       
 Keywords:                        |       Stage:  Unreviewed
Has_patch:  0                     |  
----------------------------------+-----------------------------------------
 The forms UserCreationForm and PasswordResetForm of the admin application
 instantiate a RegexField using deprecated code:

 {{{
     username = forms.RegexField(label=_("Username"), max_length=30,
 regex=r'^\w+$',
         help_text = _("Required. 30 characters or fewer. Alphanumeric
 characters only (letters, digits and underscores)."),
         error_message = _("This value must contain only letters, numbers
 and underscores."))
 }}}

 This mean that even if the "_" symbol refers to ugettext_lazy the
 translation is called at import time since the RegexField constructor
 (indirectly) calls it.

 I've attached a patch that solves this problem.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13000>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to