Ticket #4630: possible_patch_fields.py.diff
File possible_patch_fields.py.diff, 767 bytes (added by , 17 years ago) |
---|
-
fields.py
518 518 errors = ErrorList() 519 519 if self.required and not value: 520 520 raise ValidationError(gettext(u'This field is required.')) 521 elif not self.required and not value: 522 return self.compress([]) 521 elif not self.required: 522 value_empty = False 523 for v in value: 524 if v == '': 525 value_empty = True 526 break 527 if value_empty: 528 return self.compress([]) 523 529 if not isinstance(value, (list, tuple)): 524 530 raise ValidationError(gettext(u'Enter a list of values.')) 525 531 for i, field in enumerate(self.fields):