﻿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
22915	Regression in behaviour of ValidationError.update_error_dict()	Russell Keith-Magee	nobody	"The behaviour of `ValidationError.update_error_dict()` has have changed since 1.6.

The problem was introduced by rf563c339ca2eed81706ab17726c79a6f00d7c553, which was a fix for #20867, adding the `Form.add_error()` method.

Under 1.6.:
{{{
In [1]: from django.core.exceptions import ValidationError

In [2]: from django.forms.util import ErrorList

In [3]: v = ValidationError({'fieldname': ErrorList(['This is an error.'])})

In [4]: errors = ErrorList()

In [5]: new_errors = v.update_error_dict(errors)

In [6]: print new_errors
{'fieldname': [u'This is an error.']}
}}}

Under 1.7rc1:
{{{
In [1]: from django.core.exceptions import ValidationError

In [2]: from django.forms.util import ErrorList

In [3]: v = ValidationError({'fieldname': ErrorList(['This is an error.'])})

In [4]: errors = ErrorList()

In [5]: new_errors = v.update_error_dict(errors)

In [6]: print new_errors
{'fieldname': [ValidationError([u'This is an error.'])]}
}}}

That is - the error dictionary returned by update_error_dict now returns a list of ValidationErrors, not a list of error messages. You get similar problems if the original ValidationError contains a list of strings:
{{{
In [3]: v = ValidationError({'fieldname': ['This is an error.']})
}}}
or just a single standalone string:
{{{
In [3]: v = ValidationError({'fieldname': 'This is an error.'})
}}}
In each case, Django 1.6 returns the content that was provided; Django 1.7 returns a ValidationError containing a list of errors.

"	Bug	closed	Forms	1.7-alpha-1	Release blocker	fixed		loic84	Accepted	1	0	0	0	0	0
