Opened 8 years ago

Closed 8 years ago

#5471 closed (fixed)

BooleanField fails to work when processing data from as_hidden

Reported by: Paul Lanier <planier@…> Owned by: nobody
Component: Forms Version: master
Severity: Keywords: BooleanField as_hidden
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If a BooleanField is referenced in the Template with .as_hidden then the returned value for False is '0'. Since BooleanField does a simple bool() in clean, this is converted to True.

The patch adds an explicit check for '0' and returns false in this case.

Attachments (1)

newforms_fields_py.patch (526 bytes) - added by Paul Lanier <planier@…> 8 years ago.
Patch for newforms/fields.py

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by Paul Lanier <planier@…>

Patch for newforms/fields.py

comment:1 Changed 8 years ago by planier

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [6285]) Fixed #5471 -- Fixed cleaning of boolean field data when it's used as a hidden field. Patch from Paul Lanier.

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