Hide materials belong to a to-be-removed package

This commit is contained in:
Lipu Fei 2018-07-11 10:57:55 +02:00
parent 5255d6ca2a
commit 76417b7fb2
6 changed files with 46 additions and 10 deletions

View file

@ -41,10 +41,15 @@ class GenericMaterialsModel(BaseMaterialsModel):
item_list = []
for root_material_id, container_node in available_material_dict.items():
metadata = container_node.metadata
# Only add results for generic materials
if metadata["brand"].lower() != "generic":
continue
# Do not include the materials from a to-be-removed package
if bool(metadata.get("removed", False)):
continue
item = {"root_material_id": root_material_id,
"id": metadata["id"],
"name": metadata["name"],