Skip to content

Commit

Permalink
Merge pull request #211 from mbridak/session_what_session
Browse files Browse the repository at this point in the history
@mbridak Provided initial condition for root.
  • Loading branch information
mbridak authored Nov 5, 2024
2 parents 1d648a3 + 159e23d commit 05ecdb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions not1mm/lib/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def lookup(self, call: str) -> dict:
Lookup a call on QRZ
"""
logger.info("%s", call)
_response = None
root = {}
if self.session:
payload = {"s": self.session, "callsign": call}
try:
Expand All @@ -208,7 +208,7 @@ def lookup(self, call: str) -> dict:
self.qrzurl, params=payload, timeout=3.0
)
baseroot = xmltodict.parse(query_result.text)
root = baseroot.get("QRZDatabase")
root = baseroot.get("QRZDatabase", {})
return root.get("Callsign")


Expand Down

0 comments on commit 05ecdb6

Please sign in to comment.