From 074b9c67f8c0e10fc1ba42918e407f5b303c2ba7 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Thu, 11 Jan 2024 15:58:42 +0000 Subject: [PATCH] Serialise microscope ID to string UUID objects don't serialise with `json.dumps` and thus cause errors when we try to embed `thing_state` into images. --- src/openflexure_microscope_server/things/settings_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openflexure_microscope_server/things/settings_manager.py b/src/openflexure_microscope_server/things/settings_manager.py index d69ece9d..bd05d08a 100644 --- a/src/openflexure_microscope_server/things/settings_manager.py +++ b/src/openflexure_microscope_server/things/settings_manager.py @@ -111,7 +111,7 @@ class SettingsManager(Thing): def thing_state(self) -> Mapping: state = { "hostname": gethostname(), - "microscope-uuid": self.microscope_id, + "microscope-uuid": str(self.microscope_id), } metadata = self.external_metadata for k in self.external_metadata_in_state: