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