Opened 8 years ago

Closed 6 years ago

#10882 closed Bug (wontfix)

FormWizard process_step receives yet to be validated form for previous steps

Reported by: graham.carlyle@… Owned by: jashugan
Component: contrib.formtools Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX:

Description

The docs for FormWizard process_step state that "The Form is guaranteed to have clean, valid data." and so you might assume that the form it supplies is ready to use when passed to this method. However its only the current step that gets a form that has the cleaned_data property immediately accessible, whereas previous steps require the form.is_valid method to be called.

So it seems that the code should call is_valid on forms from previous steps before passing the form to process_step. Presumably as the docs state the form would always be valid and if not then somehow the hash has been defeated.

Attachments (1)

form_wizard_10882.1.diff (2.5 KB) - added by jashugan 8 years ago.
First attempt.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by jashugan

Attachment: form_wizard_10882.1.diff added

First attempt.

comment:1 Changed 8 years ago by jashugan

Has patch: set
Needs tests: set
Owner: changed from nobody to jashugan
Status: newassigned

So, this is my first patch submission. Let me know if I've done anything wrong.

This patch ensures that process_step is always passed a form with "clean, valid data." It also removes a final sanity check before done() is called, because all of the forms should be validated. I've added a valid_forms list that accumulates the forms as they are validated: first the forms preceding the current_step, then the form at the current_step.

comment:2 Changed 7 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:3 Changed 6 years ago by Chris Beaven

Severity: Normal
Type: Bug

comment:4 Changed 6 years ago by Jannis Leidel

Easy pickings: unset
Resolution: wontfix
Status: assignedclosed

Superseded by #9200.

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