Opened 6 years ago

Closed 4 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:


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

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by jashugan

First attempt.

comment:1 Changed 6 years ago by jashugan

  • Has patch set
  • Needs documentation unset
  • Needs tests set
  • Owner changed from nobody to jashugan
  • Patch needs improvement unset
  • Status changed from new to 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 Changed 6 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 5 years ago by SmileyChris

  • Severity set to Normal
  • Type set to Bug

comment:4 Changed 4 years ago by jezdez

  • Easy pickings unset
  • Resolution set to wontfix
  • Status changed from assigned to closed

Superseded by #9200.

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