mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 05:04:31 +03:00
Fixed a regression with ValidationError under Django 1.6
This commit is contained in:
parent
97430c0d9c
commit
d4a50429b0
|
@ -42,6 +42,7 @@ def pretty_name(name):
|
|||
class RelationsList(list):
|
||||
_deleted = []
|
||||
|
||||
|
||||
class NestedValidationError(ValidationError):
|
||||
"""
|
||||
The default ValidationError behavior is to stringify each item in the list
|
||||
|
@ -56,9 +57,13 @@ class NestedValidationError(ValidationError):
|
|||
|
||||
def __init__(self, message):
|
||||
if isinstance(message, dict):
|
||||
self.messages = [message]
|
||||
self._messages = [message]
|
||||
else:
|
||||
self.messages = message
|
||||
self._messages = message
|
||||
|
||||
@property
|
||||
def messages(self):
|
||||
return self._messages
|
||||
|
||||
|
||||
class DictWithMetadata(dict):
|
||||
|
|
Loading…
Reference in New Issue
Block a user