Ticket #4755: 4755.diff

File 4755.diff, 686 bytes (added by Gary Wilson <gary.wilson@…>, 17 years ago)
  • django/newforms/fields.py

    === modified file 'django/newforms/fields.py'
     
    446446            return []
    447447        if not isinstance(value, (list, tuple)):
    448448            raise ValidationError(gettext(u'Enter a list of values.'))
    449         new_value = []
    450         for val in value:
    451             val = smart_unicode(val)
    452             new_value.append(val)
     449        new_value = [smart_unicode(val) for val in value]
    453450        # Validate that each value in the value list is in self.choices.
    454451        valid_values = set([smart_unicode(k) for k, v in self.choices])
    455452        for val in new_value:
Back to Top