Opened 14 years ago

Closed 14 years ago

Last modified 13 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: no UI/UX: no

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 14 years ago.
Regression test as a patch
trac-14576.diff (1.8 KB ) - added by steph 14 years ago.
Patch and tests

Download all attachments as: .zip

Change History (10)

by Timothée Peignier, 14 years ago

Attachment: 14576-regression-test.py added

Regression test as a patch

comment:1 by Jannis Leidel, 14 years ago

milestone: 1.3
Triage Stage: UnreviewedAccepted

by steph, 14 years ago

Attachment: trac-14576.diff added

Patch and tests

comment:2 by steph, 14 years ago

Has patch: set

.. just added a patch to fix the problem.

comment:3 by steph, 14 years ago

Keywords: sprintnov13 added

comment:4 by Luke Plant, 14 years ago

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 by Ramiro Morales, 14 years ago

(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 by zyga, 14 years ago

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 by zyga, 14 years ago

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 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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