Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4390 closed (fixed)

cleaned_data can contain non-clean data

Reported by: Gary Wilson <gary.wilson@…> Owned by: Adrian Holovaty
Component: Forms Version: dev
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The value returned from a form field's clean method is stored in cleaned_data, but this value is not removed if the form's clean_<field> method raises a ValidationError.

Attachments (1)

4390.diff (841 bytes ) - added by Gary Wilson <gary.wilson@…> 17 years ago.
remove data from cleaned_data if a ValidationError was raised.

Download all attachments as: .zip

Change History (4)

by Gary Wilson <gary.wilson@…>, 17 years ago

Attachment: 4390.diff added

remove data from cleaned_data if a ValidationError was raised.

comment:1 by Gary Wilson <gary.wilson@…>, 17 years ago

Has patch: set
Triage Stage: UnreviewedDesign decision needed

Please note that this patch would not be needed if #4391 is fixed.

comment:2 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [5346]) Fixed #4390, #4385 -- Made it clear that cleaned_data wasn't being assigned to
twice without reason. Also make sure that if field specific clean functions
fail, the form-wide field cleaning is removed from cleaned_data.

comment:3 by Gary Wilson <gary.wilson@…>, 17 years ago

And much prettier code than what I posted last night :)

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