summaryrefslogtreecommitdiff
path: root/django/newforms/forms.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-14 16:06:27 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-14 16:06:27 +0000
commitfbfefbf83d1396db1ea4095b2b64e1841689b364 (patch)
treed2eb31ada06c261b5dec94ab20fc3a487ba5815a /django/newforms/forms.py
parent3916cfbaff3b0b41d977a5efb6a9d9b41b067d90 (diff)
unicode: Changed a few more places in newforms where str() was being used with
potential non-ASCII arguments. Refs #3406 (and added a test for the latter). git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5236 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms/forms.py')
-rw-r--r--django/newforms/forms.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/newforms/forms.py b/django/newforms/forms.py
index edd1992cf4..2230057c1d 100644
--- a/django/newforms/forms.py
+++ b/django/newforms/forms.py
@@ -4,7 +4,7 @@ Form classes
from django.utils.datastructures import SortedDict, MultiValueDict
from django.utils.html import escape
-from django.utils.encoding import StrAndUnicode
+from django.utils.encoding import StrAndUnicode, smart_unicode
from fields import Field
from widgets import TextInput, Textarea, HiddenInput, MultipleHiddenInput
from util import flatatt, ErrorDict, ErrorList, ValidationError
@@ -311,8 +311,8 @@ class BoundField(StrAndUnicode):
associated Form has specified auto_id. Returns an empty string otherwise.
"""
auto_id = self.form.auto_id
- if auto_id and '%s' in str(auto_id):
- return str(auto_id) % self.html_name
+ if auto_id and '%s' in smart_unicode(auto_id):
+ return smart_unicode(auto_id) % self.html_name
elif auto_id:
return self.html_name
return ''