mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Improve checking callsign validity by regex, and fix passing v1 type credentials into v2 APIs
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user