Opened 16 years ago

Closed 13 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: dev
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: no

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 15 years ago.
First attempt.

Download all attachments as: .zip

Change History (5)

by jashugan, 15 years ago

Attachment: form_wizard_10882.1.diff added

First attempt.

comment:1 by jashugan, 15 years ago

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 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Chris Beaven, 14 years ago

Severity: Normal
Type: Bug

comment:4 by Jannis Leidel, 13 years ago

Easy pickings: unset
Resolution: wontfix
Status: assignedclosed

Superseded by #9200.

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