mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Keep check for nested dict or list to catch issue with serializer using multiple fields with the same root source.
This commit is contained in:
parent
ea1bdc9ef8
commit
677acd36f7
|
@ -802,7 +802,8 @@ def raise_errors_on_nested_writes(method_name, serializer, validated_data):
|
|||
# address = serializer.CharField('profile.address')
|
||||
assert not any(
|
||||
len(field.source_attrs) > 1 and
|
||||
(field.source_attrs[0] in validated_data)
|
||||
(field.source_attrs[0] in validated_data) and
|
||||
isinstance(validated_data[field.source_attrs[0]], (list, dict))
|
||||
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