summaryrefslogtreecommitdiff
path: root/src/hydrilla
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-02-18 16:02:16 +0100
committerWojtek Kosior <koszko@koszko.org>2022-02-18 16:12:14 +0100
commitfb6dd284fad64a4b69e44aea38852b38819b5eb1 (patch)
tree244c100b744a7040ce9185b82ff99d7da4e8771f /src/hydrilla
parentf5fd82f430d765f3ed76104133ebee5d8375dc03 (diff)
downloadhaketilo-hydrilla-fb6dd284fad64a4b69e44aea38852b38819b5eb1.tar.gz
haketilo-hydrilla-fb6dd284fad64a4b69e44aea38852b38819b5eb1.zip
make "uuid" an optional property
Diffstat (limited to 'src/hydrilla')
-rw-r--r--src/hydrilla/server/serve.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/hydrilla/server/serve.py b/src/hydrilla/server/serve.py
index bb53c0a..9bcfb93 100644
--- a/src/hydrilla/server/serve.py
+++ b/src/hydrilla/server/serve.py
@@ -57,7 +57,7 @@ class ItemInfo(ABC):
"""Initialize ItemInfo using item definition read from JSON."""
self.version = util.normalize_version(item_obj['version'])
self.identifier = item_obj['identifier']
- self.uuid = item_obj['uuid']
+ self.uuid = item_obj.get('uuid')
self.long_name = item_obj['long_name']
def path(self) -> str:
@@ -111,8 +111,11 @@ class VersionedItemInfo:
"""
if self.identifier is None:
self.identifier = item_info.identifier
+
+ if self.uuid is None:
self.uuid = item_info.uuid
- elif self.uuid != item_info.uuid:
+
+ if self.uuid is not None and self.uuid != item_info.uuid:
raise ValueError(f_('uuid_mismatch_{identifier}')
.format(identifier=self.identifier))