Merge pull request #5419 from Ultimaker/CL-1282_handle_empty_string_and_none_material_ids

CL-1282 Handle "" and None as hot-end and material IDs
This commit is contained in:
Simon Edwards 2019-03-13 13:23:54 +01:00 committed by GitHub
commit e376404e5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1390,8 +1390,9 @@ class MachineManager(QObject):
need_to_show_message = False
for extruder_configuration in configuration.extruderConfigurations:
extruder_has_hotend = extruder_configuration.hotendID != ""
extruder_has_material = extruder_configuration.material.guid != ""
# We support "" or None, since the cloud uses None instead of empty strings
extruder_has_hotend = extruder_configuration.hotendID and extruder_configuration.hotendID != ""
extruder_has_material = extruder_configuration.material.guid and extruder_configuration.material.guid != ""
# If the machine doesn't have a hotend or material, disable this extruder
if not extruder_has_hotend or not extruder_has_material: