mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-26 16:09:49 +03:00
Fix not falling into initial data
This commit is contained in:
parent
2486dbf791
commit
f589cfb0be
|
@ -250,7 +250,7 @@ class BaseSerializer(Field):
|
||||||
)
|
)
|
||||||
raise AssertionError(msg)
|
raise AssertionError(msg)
|
||||||
|
|
||||||
if not hasattr(self, '_data') and not getattr(self, '_errors', None):
|
if not hasattr(self, '_data') or getattr(self, '_errors', None):
|
||||||
if self.instance is not None:
|
if self.instance is not None:
|
||||||
self._data = self.to_representation(self.instance)
|
self._data = self.to_representation(self.instance)
|
||||||
elif hasattr(self, '_validated_data'):
|
elif hasattr(self, '_validated_data'):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user