Allow None value for storm coordinates

This commit is contained in:
XANTRONIX Industrial 2025-02-13 17:44:32 -05:00
parent 5bab45b779
commit 55e179658b

View file

@ -76,10 +76,10 @@ def timezone_from_str(text: str) -> datetime.timezone:
return datetime.UTC if tz is None else tz return datetime.UTC if tz is None else tz
def coord_from_str(text_lon: str, text_lat: str): def coord_from_str(text_lon: str, text_lat: str):
lon = 0.0 if text_lon == '' else float(text_lon) if text_lon == '' or text_lat == '':
lat = 0.0 if text_lat == '' else float(text_lat) return
return Coord(lon, lat) return Coord(float(text_lon), float(text_lat))
class StormReport(DatabaseTable): class StormReport(DatabaseTable):
__slots__ = ( __slots__ = (