Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #3506 -- Changed newforms BoundField.help_text to an empty stri…

…ng if None. Thanks for the patch, Thomas Steinacher

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4528 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4a85a75fb0e3185dc77362c16e80219dac168c05 1 parent 1d5e974
Adrian Holovaty authored February 15, 2007
2  django/newforms/forms.py
@@ -218,7 +218,7 @@ def __init__(self, form, field, name):
218 218
             self.label = pretty_name(name)
219 219
         else:
220 220
             self.label = self.field.label
221  
-        self.help_text = field.help_text
  221
+        self.help_text = field.help_text or ''
222 222
 
223 223
     def __unicode__(self):
224 224
         "Renders this field as an HTML widget."
2  tests/regressiontests/forms/tests.py
@@ -3044,6 +3044,8 @@
3044 3044
 <p>Password2: <input type="password" name="password2" /></p>
3045 3045
 <input type="submit" />
3046 3046
 </form>
  3047
+>>> Template('{{ form.password1.help_text }}').render(Context({'form': UserRegistration(auto_id=False)}))
  3048
+''
3047 3049
 
3048 3050
 The label_tag() method takes an optional attrs argument: a dictionary of HTML
3049 3051
 attributes to add to the <label> tag.

0 notes on commit 4a85a75

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