Opened 3 years ago

Closed 3 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

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 Changed 3 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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

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