Opened 16 years ago
Closed 14 years ago
#10882 closed Bug (wontfix)
FormWizard process_step receives yet to be validated form for previous steps
Reported by: | 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)
Change History (5)
by , 16 years ago
Attachment: | form_wizard_10882.1.diff added |
---|
comment:1 by , 16 years ago
Has patch: | set |
---|---|
Needs tests: | set |
Owner: | changed from | to
Status: | new → assigned |
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 , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:4 by , 14 years ago
Easy pickings: | unset |
---|---|
Resolution: | → wontfix |
Status: | assigned → closed |
Superseded by #9200.
First attempt.