Merge pull request #18539 from Ultimaker/CURA-11655_fix_method_materials_loading

CURA-11655 Fix Method X/XL material selection
This commit is contained in:
Casper Lamboo 2024-03-08 13:53:49 +01:00 committed by GitHub
commit 690eb81940
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,8 @@
# Cura is released under the terms of the LGPLv3 or higher. # Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional, List from typing import Optional, List
import uuid
from .CloudClusterResponse import CloudClusterResponse from .CloudClusterResponse import CloudClusterResponse
from .ClusterPrinterStatus import ClusterPrinterStatus from .ClusterPrinterStatus import ClusterPrinterStatus
@ -11,4 +13,20 @@ class CloudClusterWithConfigResponse(CloudClusterResponse):
def __init__(self, **kwargs) -> None: def __init__(self, **kwargs) -> None:
self.configuration = self.parseModel(ClusterPrinterStatus, kwargs.get("host_printer")) self.configuration = self.parseModel(ClusterPrinterStatus, kwargs.get("host_printer"))
# Some printers will return a null UUID in the host_printer.uuid field. For those we can fall back using
# the host_guid field of the cluster data
valid_uuid = False
try:
parsed_uuid = uuid.UUID(self.configuration.uuid)
valid_uuid = parsed_uuid.int != 0
except:
pass
if not valid_uuid:
try:
self.configuration.uuid = kwargs.get("host_guid")
except:
pass
super().__init__(**kwargs) super().__init__(**kwargs)