Ticket #4804: unicode_in_oldform_choices.patch
File unicode_in_oldform_choices.patch, 963 bytes (added by , 17 years ago) |
---|
-
django/oldforms/__init__.py
3 3 from django.utils.html import escape 4 4 from django.conf import settings 5 5 from django.utils.translation import ugettext, ungettext 6 from django.utils.encoding import smart_unicode, force_unicode , smart_str6 from django.utils.encoding import smart_unicode, force_unicode 7 7 8 8 FORM_FIELD_ID_PREFIX = 'id_' 9 9 … … 502 502 503 503 def isValidChoice(self, data, form): 504 504 str_data = smart_unicode(data) 505 str_choices = [smart_ str(item[0]) for item in self.choices]505 str_choices = [smart_unicode(item[0]) for item in self.choices] 506 506 if str_data not in str_choices: 507 507 raise validators.ValidationError, ugettext("Select a valid choice; '%(data)s' is not in %(choices)s.") % {'data': str_data, 'choices': str_choices} 508 508