Opened 8 years ago

Closed 8 years ago

#17306 closed Bug (invalid)

Forms.BooleanField always fails with "Field Required" when value is false False

Reported by: anonymous Owned by: nobody
Component: Forms Version: master
Severity: Normal Keywords: boolean, none, False
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no



This line:
658 if not value and self.required:

Should be:
if value is None and self.required

Otherwise False values for BooleanFields will trigger this, when there is a value for the field, but that value is False.

Change History (1)

comment:1 Changed 8 years ago by Alex Gaynor

Resolution: invalid
Status: newclosed

It is intentional that a false value triggers this error, see #5957.

Note: See TracTickets for help on using tickets.
Back to Top