Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#14576 closed (fixed)

Regression in FormWizard

Reported by: Timothée Peignier Owned by: nobody
Component: contrib.formtools Version: 1.2
Severity: Keywords: form wizard sprintnov13
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

It seems that changeset [14291] introduced a regression in FormWizard.
The last form of the wizard is never passed to done(self, request, form_list) , that make FormWizard much useless.

Here is the regression test that should help :

def test_14291(self):
    reached = [False]
    that = self
        
    class WizardWithProcessStep(WizardClass):
        def done(self, request, form_list):
            reached[0] = True
            that.assertTrue(len(form_list) == 2)
        
    wizard = WizardWithProcessStep([WizardPageOneForm,
                                                                WizardPageTwoForm])
    
    data = {"0-field": "test",
                  "1-field": "test2",
                  "hash_0": "2fdbefd4c0cad51509478fbacddf8b13",
                  "wizard_step": "1"}
    wizard(DummyRequest(POST=data))
    self.assertTrue(reached[0])

Attachments (2)

14576-regression-test.py (1.1 KB) - added by Timothée Peignier 6 years ago.
Regression test as a patch
trac-14576.diff (1.8 KB) - added by steph 6 years ago.
Patch and tests

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by Timothée Peignier

Attachment: 14576-regression-test.py added

Regression test as a patch

comment:1 Changed 6 years ago by Jannis Leidel

milestone: 1.3
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Changed 6 years ago by steph

Attachment: trac-14576.diff added

Patch and tests

comment:2 Changed 6 years ago by steph

Has patch: set

.. just added a patch to fix the problem.

comment:3 Changed 6 years ago by steph

Keywords: sprintnov13 added

comment:4 Changed 6 years ago by Luke Plant

Resolution: fixed
Status: newclosed

(In [14574]) Fixed #14576 - FormWizard.done() method doesn't get passed the last form in the list

Thanks to cyberdelia for report and test, and steph for the initial patch.

comment:5 Changed 6 years ago by Ramiro Morales

(In [15044]) [1.2.X] Fixed #14576, #14946 - FormWizard.done() method doesn't get passed the last form in the list.

Thanks to cyberdelia for report and test, and steph for the initial patch.

Backport of r14574 from trunk.

comment:6 Changed 6 years ago by zyga

Resolution: fixed
Status: closedreopened

This bug is not fixed properly.

Instead of appending a fresh instance of the last form (using get_form()) it should just append the "form" variable as that is the already created instance of the last form and it has been validated.

The solution currently applied for 1.3 breaks accessing cleaned_data.

comment:7 Changed 6 years ago by zyga

Resolution: fixed
Status: reopenedclosed

On deeper inspection this is actually fixed properly in trunk, the patch attached to this bug is just wrong.

comment:8 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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