mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 02:21:42 +00:00
Refactor of caching & data storage part 17 #118
This commit is contained in:
@@ -79,11 +79,12 @@ class QRZ(APIQueryCallsignDataProvider):
|
||||
qrz_response = xmltodict.parse(response.content).get("QRZDatabase", {})
|
||||
if qrz_response:
|
||||
if "Callsign" in qrz_response:
|
||||
qrz_data = qrz_response.get("Callsign")
|
||||
self.status = "OK"
|
||||
self.last_update_time = datetime.now(pytz.UTC)
|
||||
self.lookup_count += 1
|
||||
# Found data, convert it to our object and return it
|
||||
return self.qrz_response_to_callsign(callsign, qrz_response.get("Callsign"))
|
||||
return self.qrz_response_to_callsign(callsign, qrz_data)
|
||||
|
||||
elif "Session" in qrz_response and "Error" in qrz_response.get("Session"):
|
||||
# Errors here are normally just "callsign not in database", no need to log that ourselves
|
||||
|
||||
Reference in New Issue
Block a user