Ticket #3406: unicode-choices-checking.patch

File unicode-choices-checking.patch, 618 bytes (added by anton@…, 17 years ago)

quick fix

  • django/newforms/fields.py

     
    354354        value = smart_unicode(value)
    355355        if value == u'':
    356356            return value
    357         valid_values = set([str(k) for k, v in self.choices])
     357        valid_values = set([smart_unicode(k) for k, v in self.choices])
    358358        if value not in valid_values:
    359359            raise ValidationError(gettext(u'Select a valid choice. %s is not one of the available choices.') % value)
    360360        return value
Back to Top