﻿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
11872	can't pass instance=None to inline formset	Tobias McNulty	Brian Rosner	"If you try to pass instance=None to a new unbound formset you get an exception:

{{{
Traceback (most recent call last):
  File ""/home/tobias/caktus/eclipse-workspace/django-trunk/tests/regressiontests/model_formsets_regress/tests.py"", line 152, in test_formset_with_none_instance
    form_set = FormSet(instance=None)
  File ""../django/forms/models.py"", line 721, in __init__
    backlink_value = getattr(self.instance, self.fk.rel.field_name)
AttributeError: 'UserSite' object has no attribute 'username'
}}}

because the formset is trying to instantiate the wrong type of model in place of the None instance.

A quick one-line change fixes the problem.  Attached is a patch with a test demonstrating the problem and the proposed solution."		closed	Forms	1.1		fixed			Accepted	1	0	0	0	0	0
