Skip to content

Commit 8bab7f8

Browse files
authored
Only apply the nested writes test to writable fields. (#4669)
1 parent 388cf76 commit 8bab7f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ def raise_errors_on_nested_writes(method_name, serializer, validated_data):
769769
isinstance(field, BaseSerializer) and
770770
(field.source in validated_data) and
771771
isinstance(validated_data[field.source], (list, dict))
772-
for key, field in serializer.fields.items()
772+
for field in serializer._writable_fields
773773
), (
774774
'The `.{method_name}()` method does not support writable nested '
775775
'fields by default.\nWrite an explicit `.{method_name}()` method for '

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy