Ticket #4804: unicode_in_oldform_choices.patch

File unicode_in_oldform_choices.patch, 963 bytes (added by django@…, 17 years ago)

Simple fix similar to #3406

  • django/oldforms/__init__.py

     
    33from django.utils.html import escape
    44from django.conf import settings
    55from django.utils.translation import ugettext, ungettext
    6 from django.utils.encoding import smart_unicode, force_unicode, smart_str
     6from django.utils.encoding import smart_unicode, force_unicode
    77
    88FORM_FIELD_ID_PREFIX = 'id_'
    99
     
    502502
    503503    def isValidChoice(self, data, form):
    504504        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]
    506506        if str_data not in str_choices:
    507507            raise validators.ValidationError, ugettext("Select a valid choice; '%(data)s' is not in %(choices)s.") % {'data': str_data, 'choices': str_choices}
    508508
Back to Top