Don't store None as capabilities, but empty list

This makes a few things easier. You could see None as being a signalling value to indicate that we don't know capabilities, but this signalling would get lost anyway in the serialising to the metadata. So just an empty list is fine for now.

Contributes to issue CURA-8671.
This commit is contained in:
Ghostkeeper 2021-12-03 13:36:06 +01:00
parent 6f8a4e93e7
commit 770adb2c02
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -37,7 +37,7 @@ class CloudClusterResponse(BaseModel):
self.friendly_name = friendly_name self.friendly_name = friendly_name
self.printer_type = printer_type self.printer_type = printer_type
self.printer_count = printer_count self.printer_count = printer_count
self.capabilities = capabilities self.capabilities = capabilities if capabilities is not None else []
super().__init__(**kwargs) super().__init__(**kwargs)
# Validates the model, raising an exception if the model is invalid. # Validates the model, raising an exception if the model is invalid.