diff options
author | Andrey Maslov <greyzmeem@gmail.com> | 2014-12-23 17:51:36 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2014-12-31 14:43:13 -0500 |
commit | 7a878ca5cb50ad65fc465cb263a44cc93629f75c (patch) | |
tree | 98954da265940ab1010e46dee2179f813dacb027 /django/core/exceptions.py | |
parent | a1487deebff7bf27a4946a9f5ddd68154fa4834d (diff) | |
download | django-7a878ca5cb50ad65fc465cb263a44cc93629f75c.tar.gz |
Fixed #24008 -- Fixed ValidationError crash with list of dicts.
Diffstat (limited to 'django/core/exceptions.py')
-rw-r--r-- | django/core/exceptions.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/core/exceptions.py b/django/core/exceptions.py index a8b432b1c6..a33fb36ea5 100644 --- a/django/core/exceptions.py +++ b/django/core/exceptions.py @@ -115,7 +115,10 @@ class ValidationError(Exception): # Normalize plain strings to instances of ValidationError. if not isinstance(message, ValidationError): message = ValidationError(message) - self.error_list.extend(message.error_list) + if hasattr(message, 'error_dict'): + self.error_list.extend(sum(message.error_dict.values(), [])) + else: + self.error_list.extend(message.error_list) else: self.message = message |