summaryrefslogtreecommitdiff
path: root/django/core/exceptions.py
diff options
context:
space:
mode:
authorAndrey Maslov <greyzmeem@gmail.com>2014-12-23 17:51:36 +0200
committerTim Graham <timograham@gmail.com>2014-12-31 14:43:13 -0500
commit7a878ca5cb50ad65fc465cb263a44cc93629f75c (patch)
tree98954da265940ab1010e46dee2179f813dacb027 /django/core/exceptions.py
parenta1487deebff7bf27a4946a9f5ddd68154fa4834d (diff)
downloaddjango-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.py5
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