summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2010-02-10 00:34:45 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2010-02-10 00:34:45 +0000
commit8f4540b2e68d4b9143d38d8af197cb4b794821b4 (patch)
tree70d65310d72d09460ef2ac3bd9a84abaee458f56 /django/forms
parent4682d693c4ab5447619d72be5626c4bbdcb655cd (diff)
Fixed #12698. Model.clean() used with a ModelForm no longer causes a KeyError when raising a ValidationError.
Note that previously it was possible to raise a ValidationError in the same place with a message_dict attribute. That behavior was a bug and will no longer have the same behavior. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12402 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/forms/models.py b/django/forms/models.py
index f343a1cbcd..0039516f47 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -317,7 +317,7 @@ class BaseModelForm(BaseForm):
try:
self.instance.clean()
except ValidationError, e:
- self._update_errors(e.message_dict)
+ self._update_errors({NON_FIELD_ERRORS: e.messages})
super(BaseModelForm, self)._clean_form()
def validate_unique(self):