From a4e4ca1e356d07cb26cc9448443387293e415eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Dukai?= Date: Fri, 13 Sep 2024 10:53:57 +0200 Subject: [PATCH] Fix Data from OGR if User is None --- design-doc.md | 1 + src/geodepot/data.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/design-doc.md b/design-doc.md index d9c8ea8..01e8b16 100644 --- a/design-doc.md +++ b/design-doc.md @@ -762,6 +762,7 @@ git lfs could be sth to use, but maybe overkill because need to set up and opera ## TODOs +- Don't specify `.geodepot` dir when providing a path/url to a repository, but the initializer should automatically use the `.geodepot` subdirectory of the provided path - Add locking mechanism to push/pull - Only print traceback in debug mode - ~~Sanitize serialize/write_to_file etc.~~ diff --git a/src/geodepot/data.py b/src/geodepot/data.py index 037d9fb..8823e23 100644 --- a/src/geodepot/data.py +++ b/src/geodepot/data.py @@ -308,7 +308,10 @@ def from_ogr_feature(cls, feature) -> Self: df.description = feature["data_description"] df.format = feature["data_format"] df.driver = feature["data_driver"] - df.changed_by = User.from_pretty(feature["data_changed_by"]) + if feature["data_changed_by"] is None: + df.changed_by = None + else: + df.changed_by = User.from_pretty(feature["data_changed_by"]) df.license = feature["data_license"] if (gref := feature.GetGeometryRef()) is not None: extent = gref.GetEnvelope()