Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
Allow null rgeoms
Browse files Browse the repository at this point in the history
  • Loading branch information
CannonLock committed Feb 10, 2024
1 parent 14c1465 commit 02c4129
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/models/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 02c4129

Please sign in to comment.