Set set_value as an object (non-static) method

This commit is contained in:
Étienne Beaulé 2022-10-19 19:13:44 -03:00 committed by GitHub
parent 17fb350d3f
commit dcbdb7158c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -337,8 +337,7 @@ class Serializer(BaseSerializer, metaclass=SerializerMetaclass):
'invalid': _('Invalid data. Expected a dictionary, but got {datatype}.')
}
@staticmethod
def set_value(dictionary, keys, value):
def set_value(self, dictionary, keys, value):
"""
Similar to Python's built in `dictionary[key] = value`,
but takes a list of nested keys instead of a single key.