From 02c41291e8d978fad4fa86e34439c8f133e5d610 Mon Sep 17 00:00:00 2001 From: Cannon Lock Date: Sat, 10 Feb 2024 15:52:56 -0600 Subject: [PATCH] Allow null rgeoms --- api/models/source.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/models/source.py b/api/models/source.py index 3ce1c63..f25c9df 100644 --- a/api/models/source.py +++ b/api/models/source.py @@ -66,7 +66,11 @@ class Sources(BaseModel): status_code: str @field_validator('geometry', mode='before') - def str_geom_to_dict(cls, value: str) -> dict: + def str_geom_to_dict(cls, value: str) -> dict or None: + + if value is None: + return None + return json.loads(value) class Config: