mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 15:13:56 -06:00
Let _findInstanceContainerDefinitionId work with DefinitionContainerInterface
But where it needs the .id field it needs to ignore this type because this works with getattr weirdness. Contributes to issue CURA-5330.
This commit is contained in:
parent
eac3c759cd
commit
b331736cb2
1 changed files with 4 additions and 4 deletions
|
@ -303,15 +303,15 @@ class CuraContainerStack(ContainerStack):
|
|||
#
|
||||
# \return The ID of the definition container to use when searching for instance containers.
|
||||
@classmethod
|
||||
def _findInstanceContainerDefinitionId(cls, machine_definition: DefinitionContainer) -> str:
|
||||
def _findInstanceContainerDefinitionId(cls, machine_definition: DefinitionContainerInterface) -> str:
|
||||
quality_definition = machine_definition.getMetaDataEntry("quality_definition")
|
||||
if not quality_definition:
|
||||
return machine_definition.id
|
||||
return machine_definition.id #type: ignore
|
||||
|
||||
definitions = ContainerRegistry.getInstance().findDefinitionContainers(id = quality_definition)
|
||||
if not definitions:
|
||||
Logger.log("w", "Unable to find parent definition {parent} for machine {machine}", parent = quality_definition, machine = machine_definition.id)
|
||||
return machine_definition.id
|
||||
Logger.log("w", "Unable to find parent definition {parent} for machine {machine}", parent = quality_definition, machine = machine_definition.id) #type: ignore
|
||||
return machine_definition.id #type: ignore
|
||||
|
||||
return cls._findInstanceContainerDefinitionId(definitions[0])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue