Django

Code

Ticket #4755: 4755.diff

File 4755.diff, 0.7 kB (added by Gary Wilson <gary.wilson@gmail.com>, 1 year ago)
  • django/newforms/fields.py

    old new  
    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: