mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-04-04 01:04:28 +03:00
Fixed render error of required nested serializer.
Fixes an error that occurs on rendering response with error that says that required nested serializer field must be specified in data.
This commit is contained in:
parent
8f6173cd8a
commit
ed72603d35
|
@ -101,7 +101,7 @@ class NestedBoundField(BoundField):
|
|||
def __getitem__(self, key):
|
||||
field = self.fields[key]
|
||||
value = self.value.get(key) if self.value else None
|
||||
error = self.errors.get(key) if self.errors else None
|
||||
error = self.errors.get(key) if isinstance(self.errors, dict) else None
|
||||
if hasattr(field, 'fields'):
|
||||
return NestedBoundField(field, value, error, prefix=self.name + '.')
|
||||
return BoundField(field, value, error, prefix=self.name + '.')
|
||||
|
|
Loading…
Reference in New Issue
Block a user