mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 10:31:42 +00:00
Refactor of caching & data storage part 14 #118
This commit is contained in:
@@ -27,11 +27,10 @@ class HamQTH(APIQueryCallsignDataProvider):
|
||||
# and password, this is valid for an hour, so our cache stores this specifically for 55 minutes.
|
||||
self._CREDENTIALS_CACHE = CachedSession(CACHE_DIR + "/urls/hamqth-creds",
|
||||
expire_after=timedelta(minutes=55))
|
||||
self.status = "Ready"
|
||||
|
||||
def _perform_new_lookup(self, callsign, lookup_credentials):
|
||||
# If we don't have HamQTH credentials, skip this lookup
|
||||
if not ((lookup_credentials.hamqth_username and lookup_credentials.hamqth_password)
|
||||
if not lookup_credentials or not ((lookup_credentials.hamqth_username and lookup_credentials.hamqth_password)
|
||||
or lookup_credentials.hamqth_session_key):
|
||||
return None
|
||||
|
||||
@@ -134,4 +133,5 @@ class HamQTH(APIQueryCallsignDataProvider):
|
||||
grid=grid,
|
||||
dxcc_id=int(data["adif"]) if "adif" in data else None,
|
||||
cq_zone=int(data["cq"]) if "cq" in data else None,
|
||||
itu_zone=int(data["itu"]) if "itu" in data else None)
|
||||
itu_zone=int(data["itu"]) if "itu" in data else None,
|
||||
location_source="HOME QTH")
|
||||
|
||||
Reference in New Issue
Block a user