Allow None value for storm coordinates
This commit is contained in:
parent
5bab45b779
commit
55e179658b
1 changed files with 3 additions and 3 deletions
|
@ -76,10 +76,10 @@ def timezone_from_str(text: str) -> datetime.timezone:
|
|||
return datetime.UTC if tz is None else tz
|
||||
|
||||
def coord_from_str(text_lon: str, text_lat: str):
|
||||
lon = 0.0 if text_lon == '' else float(text_lon)
|
||||
lat = 0.0 if text_lat == '' else float(text_lat)
|
||||
if text_lon == '' or text_lat == '':
|
||||
return
|
||||
|
||||
return Coord(lon, lat)
|
||||
return Coord(float(text_lon), float(text_lat))
|
||||
|
||||
class StormReport(DatabaseTable):
|
||||
__slots__ = (
|
||||
|
|
Loading…
Add table
Reference in a new issue