mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-25 11:04:02 +03:00
Only apply the nested writes test to writable fields. (#4669)
This commit is contained in:
parent
388cf7622c
commit
8bab7f8d58
|
@ -769,7 +769,7 @@ def raise_errors_on_nested_writes(method_name, serializer, validated_data):
|
|||
isinstance(field, BaseSerializer) and
|
||||
(field.source in validated_data) and
|
||||
isinstance(validated_data[field.source], (list, dict))
|
||||
for key, field in serializer.fields.items()
|
||||
for field in serializer._writable_fields
|
||||
), (
|
||||
'The `.{method_name}()` method does not support writable nested '
|
||||
'fields by default.\nWrite an explicit `.{method_name}()` method for '
|
||||
|
|
Loading…
Reference in New Issue
Block a user