Permalink
Browse files

The help_text attribute in forms can be a ugettext_lazy() object, so …

…be careful

not to trigger translations at import time.

I checked other usages of help_text in form fields and model fields and there
is not similar usage in __init__() methods.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8148 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
malcolmt committed Jul 30, 2008
1 parent ea45a93 commit 74dde43989517076fe7387665dbf0aec52e6d006
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/forms/fields.py
View
@@ -74,7 +74,10 @@ def __init__(self, required=True, widget=None, label=None, initial=None,
if label is not None:
label = smart_unicode(label)
self.required, self.label, self.initial = required, label, initial
- self.help_text = smart_unicode(help_text or '')
+ if help_text is None:
+ self.help_text = u''
+ else:
+ self.help_text = smart_unicode(help_text)
widget = widget or self.widget
if isinstance(widget, type):
widget = widget()

0 comments on commit 74dde43

Please sign in to comment.