mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
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
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user