Opened 17 years ago
Closed 17 years ago
#7500 closed (duplicate)
Empty Boolean Field Does Not Raise Validation Error When Required
| Reported by: | Alex Gaynor | Owned by: | nobody | 
|---|---|---|---|
| Component: | Forms | Version: | dev | 
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | yes | 
| Easy pickings: | no | UI/UX: | no | 
Description
The boolean field doesn't raise a ValidationError when it is required and no data is input.  This is because BooleanField's clean method(and it's widget), evaluate to either True or False, False used to evaluate to None, and False was left out of the EMPTY_VALUES list, which is what is checked to see if a field needs to raise a validation error when a field is required.
Attachments (1)
Change History (3)
by , 17 years ago
comment:1 by , 17 years ago
| Has patch: | set | 
|---|---|
| Patch needs improvement: | set | 
| Triage Stage: | Unreviewed → Accepted | 
comment:2 by , 17 years ago
| Resolution: | → duplicate | 
|---|---|
| Status: | new → closed | 
Marking as a dupe of #5957, I am an idiot.
  Note:
 See   TracTickets
 for help on using tickets.
    
This breaks one test because a test that used to raise "Value not in options" now raises "this field is required", not sure what the fix for that is.