Remove check for if variant container is a variant container

The filter on type=variant is right above it in the same function, 20 lines of code earlier. I think this check is superfluous then.

Contributes to issue CURA-5045.
This commit is contained in:
Ghostkeeper 2018-03-27 14:26:05 +02:00
parent bc0a3e7fe2
commit dd3b49e80d
No known key found for this signature in database
GPG Key ID: 5252B696FB5E7C7A

View File

@ -89,12 +89,8 @@ class VariantManager:
if variant_definition not in self._machine_to_buildplate_dict_map:
self._machine_to_buildplate_dict_map[variant_definition] = OrderedDict()
variant_container = self._container_registry.findContainers(type = "variant", id = variant_metadata["id"])
if not variant_container:
# ERROR: not variant container. This should never happen
raise RuntimeError("Not variant found [%s], type [%s] for machine [%s]" %
(variant_name, variant_type, variant_definition))
buildplate_type = variant_container[0].getProperty("machine_buildplate_type", "value")
variant_container = self._container_registry.findContainers(type = "variant", id = variant_metadata["id"])[0]
buildplate_type = variant_container.getProperty("machine_buildplate_type", "value")
if buildplate_type not in self._machine_to_buildplate_dict_map[variant_definition]:
self._machine_to_variant_dict_map[variant_definition][buildplate_type] = dict()