Ticket #4630: possible_patch_fields.py.diff

File possible_patch_fields.py.diff, 767 bytes (added by Glin <glin@…>, 17 years ago)
  • fields.py

     
    518518        errors = ErrorList()
    519519        if self.required and not value:
    520520            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([])
    523529        if not isinstance(value, (list, tuple)):
    524530            raise ValidationError(gettext(u'Enter a list of values.'))
    525531        for i, field in enumerate(self.fields):
Back to Top