mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 08:14:16 +03:00
Merge pull request #1216 from linovia/master
Fixed a regression with ValidationError under Django 1.6
This commit is contained in:
commit
541871feca
|
@ -42,6 +42,7 @@ def pretty_name(name):
|
||||||
class RelationsList(list):
|
class RelationsList(list):
|
||||||
_deleted = []
|
_deleted = []
|
||||||
|
|
||||||
|
|
||||||
class NestedValidationError(ValidationError):
|
class NestedValidationError(ValidationError):
|
||||||
"""
|
"""
|
||||||
The default ValidationError behavior is to stringify each item in the list
|
The default ValidationError behavior is to stringify each item in the list
|
||||||
|
@ -56,9 +57,13 @@ class NestedValidationError(ValidationError):
|
||||||
|
|
||||||
def __init__(self, message):
|
def __init__(self, message):
|
||||||
if isinstance(message, dict):
|
if isinstance(message, dict):
|
||||||
self.messages = [message]
|
self._messages = [message]
|
||||||
else:
|
else:
|
||||||
self.messages = message
|
self._messages = message
|
||||||
|
|
||||||
|
@property
|
||||||
|
def messages(self):
|
||||||
|
return self._messages
|
||||||
|
|
||||||
|
|
||||||
class DictWithMetadata(dict):
|
class DictWithMetadata(dict):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user