Ticket #3482: 4490.diff
File 4490.diff, 941 bytes (added by , 18 years ago) |
---|
-
django/newforms/fields.py
373 373 raise ValidationError(gettext(u'This field is required.')) 374 374 elif not self.required and not value: 375 375 return [] 376 elif not self.required and len(value) == 1 and not value[0]: 377 return value 376 378 if not isinstance(value, (list, tuple)): 377 379 raise ValidationError(gettext(u'Enter a list of values.')) 378 380 new_value = [] -
tests/regressiontests/forms/tests.py
1574 1574 [] 1575 1575 >>> f.clean(None) 1576 1576 [] 1577 >>> f.clean(['']) 1578 [''] 1577 1579 >>> f.clean([1]) 1578 1580 [u'1'] 1579 1581 >>> f.clean(['1'])