fixes update of cache when the type has changed

When an attribute changes from, say, a quantity to an enumeration, the enum key in the serialization was not added to the
cache, and thus the frontend was not able to render the enum.
This commit is contained in:
Mose Müller 2024-03-05 13:23:26 +01:00
parent 36c863e845
commit f2cf0d9c1a

View File

@ -269,12 +269,11 @@ def set_nested_value_by_path(
# setting the new value
serialized_value = dump(value)
if "readonly" in current_dict:
if current_dict["type"] != "method":
current_dict["type"] = serialized_value["type"]
current_dict["value"] = serialized_value["value"]
else:
current_dict.update(serialized_value)
serialized_value.pop("readonly", None)
value_type = serialized_value.pop("type")
if "readonly" in current_dict and current_dict["type"] != "method":
current_dict["type"] = value_type
current_dict.update(serialized_value)
def get_nested_dict_by_path(