Fix a bug where some WWFF references had "-" for lat/lon/grid and Spothole did not deal with them well.

This commit is contained in:
Ian Renton
2026-01-18 07:40:51 +00:00
parent 4d344021c7
commit 522f90af97
3 changed files with 28 additions and 13 deletions

View File

@@ -284,9 +284,13 @@ class Spot:
# DX Grid to lat/lon and vice versa in case one is missing
if self.dx_grid and not self.dx_latitude:
ll = locator_to_latlong(self.dx_grid)
self.dx_latitude = ll[0]
self.dx_longitude = ll[1]
try:
print(json.dumps(self))
ll = locator_to_latlong(self.dx_grid)
self.dx_latitude = ll[0]
self.dx_longitude = ll[1]
except:
logging.debug("Invalid grid received for spot")
if self.dx_latitude and self.dx_longitude and not self.dx_grid:
try:
self.dx_grid = latlong_to_locator(self.dx_latitude, self.dx_longitude, 8)