mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.7.x] Fixed #24008 -- Fixed ValidationError crash with list of dicts.
Backport of 7a878ca5cb from master
This commit is contained in:
committed by
Tim Graham
parent
4abfa73c18
commit
8de2a44064
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user