﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
8171	Invalid formset when form is missing from POST data	James Chua <james_027@…>	Brian Rosner	"A forms that doesn't have ordered prefix will not be process. On the sample the formset is expecting to process choices-0, choices-1, and choices-2 forms while choices-4, and choices-5 forms will be ignore but it should be process because the 3 forms we are referring here are the choices-0, choices-4, choices-5 and it should return False on formset.is_valid() since the choices-4 is invalid while choices-5 is considered valid since it is blank. As a result the formset is valid because it treats blank forms as valid which are choices-1 and choices-2.

{{{
>>> data = {
...     'choices-TOTAL_FORMS': '3', # the number of forms rendered
...     'choices-INITIAL_FORMS': '0', # the number of forms with initial data
...     'choices-0-choice': 'Calexico',
...     'choices-0-votes': '100',
...     'choices-4-choice': 'The Decemberists',
...     'choices-4-votes': '', # missing value
...     'choices-5-choice': '',
...     'choices-5-votes': '',
... }

>>> formset = ChoiceFormSet(data, auto_id=False, prefix='choices')
>>> formset.is_valid()
True
}}}"		closed	Forms	dev		wontfix	formsets		Accepted	0	0	0	0	0	0
