Fix a potential NPE and a case where callsign location source could be reported as None instead of DXCC.

This commit is contained in:
Ian Renton
2026-09-11 07:32:15 +01:00
parent 3b575de36a
commit 64bb8ef3eb
12 changed files with 21 additions and 23 deletions
-3
View File
@@ -71,7 +71,6 @@ class ModeSource(str, Enum):
SPOT = "SPOT"
COMMENT = "COMMENT"
BANDPLAN = "BANDPLAN"
NONE = "NONE"
class LocationSourceForSpot(str, Enum):
@@ -82,7 +81,6 @@ class LocationSourceForSpot(str, Enum):
GRID = "GRID"
HOME_QTH = "HOME QTH"
DXCC = "DXCC"
NONE = "NONE"
class LocationSourceForCallsign(str, Enum):
@@ -90,7 +88,6 @@ class LocationSourceForCallsign(str, Enum):
HOME_QTH = "HOME QTH"
DXCC = "DXCC"
NONE = "NONE"
class SIGRefType(str, Enum):
+3 -2
View File
@@ -43,8 +43,9 @@ def get_sig_ref_info(sig_name, ref_id):
# database.
if sig_name.upper() == "DME":
match = re.match(r"DME[\- ](\d{3,5})", ref_id, re.IGNORECASE)
number = match.group(1)
ref_id = f"DME-{number.zfill(5)}"
if match:
number = match.group(1)
ref_id = f"DME-{number.zfill(5)}"
# DTMBA spotters sometimes include spaces and dashes, our regex allows them but they must be removed here so we
# can look up against the official list which doesn't have them