mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Move manual criterion into base criteria filter
This code was filtering on certain criteria, and then filtering the results based on an additional metadata field. Let's just move that last field in the original criteria too... Contributes to issue CURA-4243.
This commit is contained in:
parent
7745113704
commit
2fc198a7ad
1 changed files with 6 additions and 4 deletions
|
@ -209,11 +209,13 @@ class QualityManager:
|
|||
definition_id = "fdmprinter"
|
||||
if base_material:
|
||||
# There is a basic material specified
|
||||
criteria = { "type": "material", "name": base_material, "definition": definition_id }
|
||||
criteria = {
|
||||
"type": "material",
|
||||
"name": base_material,
|
||||
"definition": definition_id,
|
||||
"variant": material_container.getMetadataEntry("variant")
|
||||
}
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(**criteria)
|
||||
containers = [basic_material for basic_material in containers if
|
||||
basic_material.getMetaDataEntry("variant") == material_container.getMetaDataEntry(
|
||||
"variant")]
|
||||
return containers
|
||||
|
||||
return []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue