Ticket #3482: 3482.diff
File 3482.diff, 936 bytes (added by , 18 years ago) |
---|
-
django/newforms/fields.py
374 374 raise ValidationError(gettext(u'This field is required.')) 375 375 elif not self.required and not value: 376 376 return [] 377 elif not self.required and len(value) == 1 and not value[0]: 378 return [] 377 379 if not isinstance(value, (list, tuple)): 378 380 raise ValidationError(gettext(u'Enter a list of values.')) 379 381 new_value = [] -
tests/regressiontests/forms/tests.py
1602 1602 [] 1603 1603 >>> f.clean(None) 1604 1604 [] 1605 >>> f.clean(['']) 1606 [] 1605 1607 >>> f.clean([1]) 1606 1608 [u'1'] 1607 1609 >>> f.clean(['1'])