Improve checking callsign validity by regex, and fix passing v1 type credentials into v2 APIs

This commit is contained in:
Ian Renton
2026-08-17 16:30:24 +01:00
parent 03164d747f
commit 38bc03a603
19 changed files with 48 additions and 36 deletions
+3 -1
View File
@@ -1,3 +1,4 @@
from core.constants import CALL_ONLY_PATTERN
from core.data_providers import DATA_PROVIDERS
from data.callsign import Callsign
@@ -9,7 +10,8 @@ def get_call_info(callsign, lookup_credentials):
callsign_data = Callsign(call=callsign)
if callsign:
# First check our input looks like a real callsign
if callsign and CALL_ONLY_PATTERN.match(callsign):
# Sort callsign providers by priority order, so we query the highest priority (lowest numbers) first, and only
# query other providers for data we are missing as we go along.
for p in sorted(DATA_PROVIDERS.callsign_data_providers, key=lambda p2: p2.priority):