summaryrefslogtreecommitdiff
path: root/django/forms/fields.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-07-30 05:50:24 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-07-30 05:50:24 +0000
commit74dde43989517076fe7387665dbf0aec52e6d006 (patch)
tree91076dc11758aec3cb79d191a79e5aa95bf4dae2 /django/forms/fields.py
parentea45a932d3f438a9f2ce6f59c545b299e425d5e6 (diff)
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
Diffstat (limited to 'django/forms/fields.py')
-rw-r--r--django/forms/fields.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py
index f2c3b97475..47ae5e11b2 100644
--- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -74,7 +74,10 @@ class Field(object):
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()