You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems there's a typo in Serializer.run_validators method which is supposed to update initial data with default values from read-only fields. Instead, the value remains unchanged.
def run_validators(self, value):
"""
Add read_only fields with defaults to value before running validators.
"""
if isinstance(value, dict):
to_validate = self._read_only_defaults()
to_validate.update(value)
else:
to_validate = value
super().run_validators(to_validate)
Looks like it should be value.update(to_validate) instead of to_validate.update(value)
The text was updated successfully, but these errors were encountered:
It seems there's a typo in
Serializer.run_validators
method which is supposed to update initial data with default values from read-only fields. Instead, the value remains unchanged.Looks like it should be
value.update(to_validate)
instead ofto_validate.update(value)
The text was updated successfully, but these errors were encountered: