Fix models using new MaterialNode class

The new one doesn't have getMetadata. Maybe we should allow it to have that actually.

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-08-13 17:18:18 +02:00
parent 54b46abd0f
commit 7d1f8e981b
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
3 changed files with 10 additions and 14 deletions

View file

@ -1,4 +1,4 @@
# Copyright (c) 2018 Ultimaker B.V.
# Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from cura.Machines.Models.BaseMaterialsModel import BaseMaterialsModel
@ -19,10 +19,8 @@ class FavoriteMaterialsModel(BaseMaterialsModel):
item_list = []
for root_material_id, container_node in self._available_materials.items():
metadata = container_node.getMetadata()
# Do not include the materials from a to-be-removed package
if bool(metadata.get("removed", False)):
if bool(container_node.getMetaDataEntry("removed", False)):
continue
# Only add results for favorite materials