[Django] #20116: ValidationError in form wizard with formsets

15 views
Skip to first unread message

Django

unread,
Mar 23, 2013, 8:09:43 AM3/23/13
to django-...@googlegroups.com
#20116: ValidationError in form wizard with formsets
-----------------------------------+-----------------------------
Reporter: foonicorn | Owner: nobody
Type: Bug | Status: new
Component: contrib.formtools | Version: 1.5
Severity: Normal | Keywords: formset, wizard
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+-----------------------------
I encountered an issue with the form wizard when the first step is a
formset and the user resends a later step after completing the wizard.

Scenario:
Complete the wizard successfully
Hit the browser back button (page usually comes from cache then)
Send the last form again

Because the wizard's storage gets reseted after completion, the wizard
will start with the first step. If the first step is a formset, its
ManagementForm raises a ValidationError because the data is passed but
doesn't contain the expected values.

--
Ticket URL: <https://code.djangoproject.com/ticket/20116>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 23, 2013, 8:23:16 AM3/23/13
to django-...@googlegroups.com
#20116: ValidationError in form wizard with formsets
-----------------------------------+--------------------------------------

Reporter: foonicorn | Owner: nobody
Type: Bug | Status: new
Component: contrib.formtools | Version: 1.5
Severity: Normal | Resolution:

Keywords: formset, wizard | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by aaugustin):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Is this the same problem as #19189?

--
Ticket URL: <https://code.djangoproject.com/ticket/20116#comment:1>

Django

unread,
Mar 23, 2013, 10:34:34 AM3/23/13
to django-...@googlegroups.com
#20116: ValidationError in form wizard with formsets
-----------------------------------+--------------------------------------

Reporter: foonicorn | Owner: nobody
Type: Bug | Status: new
Component: contrib.formtools | Version: 1.5
Severity: Normal | Resolution:

Keywords: formset, wizard | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by steph):

No, I think this is another problem, because #19189 is about re-validating
things an sending a user back to a form. This ticket is about an finished
wizard (done was called and response was rendered) and the user clicks the
back button of the browser.

--
Ticket URL: <https://code.djangoproject.com/ticket/20116#comment:2>

Django

unread,
Mar 24, 2013, 5:48:47 AM3/24/13
to django-...@googlegroups.com
#20116: ValidationError in form wizard with formsets
-----------------------------------+--------------------------------------
Reporter: foonicorn | Owner: foonicorn
Type: Bug | Status: assigned
Component: contrib.formtools | Version: 1.5
Severity: Normal | Resolution:

Keywords: formset, wizard | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by foonicorn):

* status: new => assigned
* owner: nobody => foonicorn
* has_patch: 0 => 1


Comment:

I've created a patch that renders the unbound first step if a POST request
is sent to a not initialized wizard (storage has no current step). This is
the wizard's behavior with normal forms.

Because of this I had to update some tests which did POST requests without
preceding GET.

The named wizard is not affected by the issue because the step is
addressed in the URL and the data is always directed to the correct form.
However in one case step_url had to be assigned to storage.current_step to
make the behavior consistent.

https://github.com/foonicorn/django/commit/e95124e11ddfcfec356ade1026f6ddfa58bbbd89

--
Ticket URL: <https://code.djangoproject.com/ticket/20116#comment:3>

Django

unread,
Mar 24, 2013, 7:24:48 AM3/24/13
to django-...@googlegroups.com
#20116: ValidationError in form wizard with formsets
-----------------------------------+--------------------------------------
Reporter: foonicorn | Owner: foonicorn
Type: Bug | Status: assigned
Component: contrib.formtools | Version: 1.5
Severity: Normal | Resolution:

Keywords: formset, wizard | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by foonicorn):

Updated patch with tests for correct step after each POST request in
`FormsetWizardTests`

https://github.com/foonicorn/django/commit/d906b549065d231a8849ce0c94c7458e18bde08f

--
Ticket URL: <https://code.djangoproject.com/ticket/20116#comment:4>

Django

unread,
Aug 17, 2013, 4:36:03 PM8/17/13
to django-...@googlegroups.com
#20116: ValidationError in form wizard with formsets
-----------------------------------+-------------------------------------

Reporter: foonicorn | Owner: foonicorn
Type: Bug | Status: assigned
Component: contrib.formtools | Version: 1.5
Severity: Normal | Resolution:
Keywords: formset, wizard | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+-------------------------------------
Changes (by wim@…):

* stage: Unreviewed => Accepted


Comment:

Hi. For me, this ticket is accepted as an end user should not encounter a
validation error in this case.

--
Ticket URL: <https://code.djangoproject.com/ticket/20116#comment:5>

Django

unread,
Aug 13, 2014, 8:26:15 AM8/13/14
to django-...@googlegroups.com
#20116: ValidationError in form wizard with formsets
-----------------------------------+-------------------------------------
Reporter: foonicorn | Owner: foonicorn
Type: Bug | Status: assigned
Component: contrib.formtools | Version: 1.5

Severity: Normal | Resolution:
Keywords: formset, wizard | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+-------------------------------------
Changes (by timgraham):

* needs_docs: 0 => 1


Comment:

Requiring a GET before each POST seems to be backwards incompatible, at
least for tests, so that would need to be documented.

--
Ticket URL: <https://code.djangoproject.com/ticket/20116#comment:6>

Django

unread,
Oct 20, 2014, 1:58:48 PM10/20/14
to django-...@googlegroups.com
#20116: ValidationError in form wizard with formsets
-----------------------------------+-------------------------------------
Reporter: foonicorn | Owner: foonicorn
Type: Bug | Status: closed
Component: contrib.formtools | Version: 1.5
Severity: Normal | Resolution: fixed

Keywords: formset, wizard | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+-------------------------------------
Changes (by gchp):

* status: assigned => closed
* resolution: => fixed


Comment:

formtools has been extracted into its own repository
(​​https://github.com/django/django-formtools/). Because of this, the
issue tracking for this package has been moved to GitHub issues. I'm going
to close this ticket, but I've created a GitHub issue to replace it where
the conversation can continue: ​​https://github.com/django/django-
formtools/issues/20. Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/20116#comment:7>

Reply all
Reply to author
Forward
0 new messages