Code

Opened 7 years ago

Closed 7 years ago

#4981 closed (wontfix)

Unchecked BooleanFields raise validation error

Reported by: Caleb <jtxx000@…> Owned by: adrian
Component: Forms Version: master
Severity: Keywords: BooleanField
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

BooleanFields should not call "super(BooleanField, self).clean(value)" as that raises a validation error if the field is not included in the data, and unchecked boolean fields aren't included in HTTP POST.

Attachments (1)

patch.diff (361 bytes) - added by Caleb <jtxx000@…> 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by Caleb <jtxx000@…>

comment:1 Changed 7 years ago by SmileyChris

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

It's supposed to. Try required=False

comment:2 Changed 7 years ago by Caleb <jtxx000@…>

  • Resolution invalid deleted
  • Status changed from closed to reopened

What's the point of a checkbox that has to be checked? The docs say that BooleanFields will never raise a validation error.

comment:3 Changed 7 years ago by simonbun <simonbun@…>

One use case off the top of my head: Having users agree to a site's terms of service by checking a box.

comment:4 Changed 7 years ago by adrian

  • Resolution set to wontfix
  • Status changed from reopened to closed

Closing for the reasons pointed out in the comments.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.