mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
parent
71a8cb2282
commit
f2dd05a6e6
|
@ -681,8 +681,8 @@ class ModelSerializer(Serializer):
|
||||||
|
|
||||||
def update(self, instance, validated_attrs):
|
def update(self, instance, validated_attrs):
|
||||||
assert not any(
|
assert not any(
|
||||||
isinstance(field, BaseSerializer) and not field.read_only
|
isinstance(field, BaseSerializer) and (key in validated_attrs)
|
||||||
for field in self.fields.values()
|
for key, field in self.fields.values()
|
||||||
), (
|
), (
|
||||||
'The `.update()` method does not suport nested writable fields '
|
'The `.update()` method does not suport nested writable fields '
|
||||||
'by default. Write an explicit `.update()` method for serializer '
|
'by default. Write an explicit `.update()` method for serializer '
|
||||||
|
|
Loading…
Reference in New Issue
Block a user