summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-29 19:05:52 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-29 19:05:52 +0000
commit931b9f310854e30a814cb3073c67007e709f6e5f (patch)
tree55d8111ca0d134c14711cd44e532fc4f89ca917d
parentefed04b6346b5eab4e01af66f9928275521ac30b (diff)
Fixed #5811 -- Added an explicit conversion to unicode that was otherwise causing problems in some cases. Thanks, Mike Maravillo.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7186 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/newforms/forms.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/newforms/forms.py b/django/newforms/forms.py
index b4ac80c5aa..2c481e47a8 100644
--- a/django/newforms/forms.py
+++ b/django/newforms/forms.py
@@ -129,7 +129,7 @@ class BaseForm(StrAndUnicode):
bf_errors = self.error_class([escape(error) for error in bf.errors]) # Escape and cache in local variable.
if bf.is_hidden:
if bf_errors:
- top_errors.extend(['(Hidden field %s) %s' % (name, force_unicode(e)) for e in bf_errors])
+ top_errors.extend([u'(Hidden field %s) %s' % (name, force_unicode(e)) for e in bf_errors])
hidden_fields.append(unicode(bf))
else:
if errors_on_separate_row and bf_errors:
@@ -150,7 +150,7 @@ class BaseForm(StrAndUnicode):
help_text = u''
output.append(normal_row % {'errors': force_unicode(bf_errors), 'label': force_unicode(label), 'field': unicode(bf), 'help_text': help_text})
if top_errors:
- output.insert(0, error_row % top_errors)
+ output.insert(0, error_row % force_unicode(top_errors))
if hidden_fields: # Insert any hidden fields in the last row.
str_hidden = u''.join(hidden_fields)
if output: