﻿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
10806	raise TypeError on form instantiation if data/files parameter isn't a dict.	Adi J. Sieker	nobody	"No error is thrown if a form is passed a non dict value to it's data or files parameter on instantiation.
When the form is validated a AttributeError: 'type' object has no attribute 'get' is raised.
I found it confusing that the form instantiation was ok and but somewhere in my template everything broke.

The attached patch checks that the data/files are instances of dict or django.utils.datastructures.MergeDict
if not it raises a TypeError.

Tests are included.

There are 2 issues that need to be looked at:

 1. passing an instance of something that behaves like a dict but isn't a subclass of dict or MergeDict,
    won't work with this patch applied, which I'm not really happy about but my python-fu isn't strong
    enough to come up with a better solution. Rewriting the patch to use getattr is a possibility.
 2. It might be considered an backwards incompatible change since now TypeError can be raised.


"		closed	Forms	dev		wontfix	KeyError forms dict instantiation	Adi J. Sieker	Design decision needed	0	0	0	0	0	0
