Code

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4390 closed (fixed)

cleaned_data can contain non-clean data

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

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@…> 7 years ago.
remove data from cleaned_data if a ValidationError was raised.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by Gary Wilson <gary.wilson@…>

remove data from cleaned_data if a ValidationError was raised.

comment:1 Changed 7 years ago by Gary Wilson <gary.wilson@…>

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

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

comment:2 Changed 7 years ago by mtredinnick

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

(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 Changed 7 years ago by Gary Wilson <gary.wilson@…>

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

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.