mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-24 08:14:32 +00:00
First attempt at converting "sig" to "activity" for v3
This commit is contained in:
@@ -70,20 +70,20 @@ class ParksNPeaks(HTTPSpotProvider):
|
||||
ref_id = source_spot["actSiteID"]
|
||||
|
||||
if activity:
|
||||
spot.sig = activity
|
||||
spot.activity = activity
|
||||
|
||||
if ref_id:
|
||||
activity_refs = [
|
||||
ActivityRef(
|
||||
id=ref_id,
|
||||
sig=activity,
|
||||
activity=activity,
|
||||
# Free text location is not present in all spots, so only add it if it's set
|
||||
name=source_spot["actLocation"]
|
||||
if "actLocation" in source_spot and source_spot["actLocation"] != ""
|
||||
else None,
|
||||
)
|
||||
]
|
||||
spot.sig_refs = activity_refs
|
||||
spot.activity_refs = activity_refs
|
||||
|
||||
else:
|
||||
# If no actSiteID is set, e.g. because actClass is "QRP", sometimes we still have an actLocation
|
||||
@@ -128,9 +128,9 @@ class ParksNPeaks(HTTPSpotProvider):
|
||||
raise ValueError(
|
||||
"Parks N Peaks user ID and API key are required. Get yours from your Parks N Peaks account."
|
||||
)
|
||||
ref_id = spot.sig_refs[0].id if spot.sig_refs else ""
|
||||
ref_id = spot.activity_refs[0].id if spot.activity_refs else ""
|
||||
body = {
|
||||
"actClass": spot.sig or "",
|
||||
"actClass": spot.activity or "",
|
||||
"actCallsign": spot.dx_call,
|
||||
"actSite": ref_id,
|
||||
"mode": spot.mode or "",
|
||||
|
||||
Reference in New Issue
Block a user