Opened 17 years ago

Closed 17 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: dev
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: no UI/UX: no

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@…> 17 years ago.
Patch for newforms/fields.py

Download all attachments as: .zip

Change History (3)

by Paul Lanier <planier@…>, 17 years ago

Attachment: newforms_fields_py.patch added

Patch for newforms/fields.py

comment:1 by planier, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:2 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(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