Store correct ID in metadata after deserialising

Contributes to issue CURA-4243.
This commit is contained in:
Ghostkeeper 2017-11-21 12:50:10 +01:00
parent 4fa38c26e8
commit def7b6994d
No known key found for this signature in database
GPG Key ID: 5252B696FB5E7C7A

View File

@ -652,7 +652,8 @@ class XmlMaterialProfile(InstanceContainer):
base_metadata = {
"type": "material",
"status": "unknown", #TODO: Add material verification.
"container_type": XmlMaterialProfile
"container_type": XmlMaterialProfile,
"id": container_id
}
try:
@ -751,6 +752,7 @@ class XmlMaterialProfile(InstanceContainer):
new_material_metadata = {}
new_material_metadata.update(base_metadata)
new_material_metadata["id"] = new_material_id
new_material_metadata["compatible"] = machine_compatibility
new_material_metadata["machine_manufacturer"] = machine_manufacturer
@ -790,6 +792,7 @@ class XmlMaterialProfile(InstanceContainer):
new_hotend_material_metadata["variant"] = variant_containers[0]["id"]
new_hotend_material_metadata["compatible"] = hotend_compatibility
new_hotend_material_metadata["machine_manufacturer"] = machine_manufacturer
new_hotend_material_metadata["id"] = new_hotend_id
if len(found_materials) == 0:
result_metadata.append(new_hotend_material_metadata)