sig->activity and multiple activity changes for API v3. #143

This commit is contained in:
ian
2026-09-25 07:01:13 +01:00
committed by Ian Renton
parent 02d08c17cd
commit ecdcbe17e9
92 changed files with 1113 additions and 796 deletions
+3 -3
View File
@@ -27,7 +27,7 @@ def get_activity_ref_info(activity_name, ref_id):
ref_id = ref_id.replace(" ", "-")
# Prepare the object to be returned
activity_ref = ActivityRef(sig=activity_name, id=ref_id)
activity_ref = ActivityRef(activity=activity_name, id=ref_id)
# We can always get the reference type and the icon from the activity itself
activity = get_activity_by_name(activity_name)
@@ -141,11 +141,11 @@ def get_activity_ref_info(activity_name, ref_id):
def populate_missing_activity_ref_info(activity_ref):
"""Look up details of an activity reference (e.g. POTA park) such as name, lat/lon, and grid. Takes in an
activity_ref object which must at minimum have a "sig" and an "id". The rest of the object will be populated
activity_ref object which must at minimum have an "activity" and an "id". The rest of the object will be populated
and returned. Any data currently in the object will be kept, only missing data in the object will be populated
if it can be determined."""
lookup_data = get_activity_ref_info(activity_ref.sig, activity_ref.id)
lookup_data = get_activity_ref_info(activity_ref.activity, activity_ref.id)
if lookup_data:
# Copy new activity ref data into existing object where data was previously missing