mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Check source attrs when checking for nested writes.
This commit is contained in:
parent
3c420cfad5
commit
90a57ad80b
|
@ -801,9 +801,8 @@ def raise_errors_on_nested_writes(method_name, serializer, validated_data):
|
||||||
# ...
|
# ...
|
||||||
# address = serializer.CharField('profile.address')
|
# address = serializer.CharField('profile.address')
|
||||||
assert not any(
|
assert not any(
|
||||||
'.' in field.source and
|
len(field.source_attrs) and
|
||||||
(key in validated_data) and
|
(field.source_attrs[0] in validated_data)
|
||||||
isinstance(validated_data[key], (list, dict))
|
|
||||||
for key, field in serializer.fields.items()
|
for key, field in serializer.fields.items()
|
||||||
), (
|
), (
|
||||||
'The `.{method_name}()` method does not support writable dotted-source '
|
'The `.{method_name}()` method does not support writable dotted-source '
|
||||||
|
|
Loading…
Reference in New Issue
Block a user