From aa5b788b5923b8b3d884d75d88022f28dbb78ba3 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 4 Nov 2019 11:30:48 +0100 Subject: [PATCH] Fix issue with profiles getting added to non creality printers in upgrade --- .../VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py b/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py index a5a77a91e0..b70d5190eb 100644 --- a/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py +++ b/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py @@ -325,6 +325,8 @@ class VersionUpgrade41to42(VersionUpgrade): material_id = parser["containers"]["3"] old_quality_id = parser["containers"]["2"] if material_id in _creality_quality_per_material and old_quality_id in _creality_quality_per_material[material_id]: + if definition_id == "creality_cr10_extruder_0": # We can't disambiguate between Creality CR-10 and Creality-CR10S since they share the same extruder definition. Have to go by the name. + if "cr-10s" in parser["metadata"].get("machine", "Creality CR-10").lower(): # Not perfect, since the user can change this name :( parser["containers"]["2"] = _creality_quality_per_material[material_id][old_quality_id] stack_copy = {} # type: Dict[str, str] # Make a copy so that we don't modify the dict we're iterating over.