Ticket #5957: newforms-booleanfield-required.patch

File newforms-booleanfield-required.patch, 476 bytes (added by anonymous, 17 years ago)
  • django/newforms/fields.py

     
    542542        # will submit for False.
    543543        if value == '0':
    544544            return False
     545        if self.required and not value:
     546            raise ValidationError(self.error_messages['required'])
    545547        return bool(value)
    546548
    547549class NullBooleanField(BooleanField):
Back to Top