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:46:17 -0500 |
| commit | 8de2a44064ca11749579a5887f59821fa35e1fdc (patch) | |
| tree | c00eed71805594a8af624fcb4c6b4df1fa763cd4 /django/core/exceptions.py | |
| parent | 4abfa73c1861c53d43f0448726346866b04b9b72 (diff) | |
[1.7.x] Fixed #24008 -- Fixed ValidationError crash with list of dicts.
Backport of 7a878ca5cb50ad65fc465cb263a44cc93629f75c from master
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 28e712e0a5..0e333d06e5 100644 --- a/django/core/exceptions.py +++ b/django/core/exceptions.py @@ -118,7 +118,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 |
