Opened 13 years ago

Closed 13 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: dev
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

Description

In forms.py

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 by Alex Gaynor, 13 years ago

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