1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-24 23:39:37 +02:00

feat: update localization files and add adventure creation messages; refine adventure filtering logic

This commit is contained in:
Sean Morley 2025-01-16 21:15:22 -05:00
parent 62efa2478e
commit 2b78021155
12 changed files with 117 additions and 30 deletions

View file

@ -1409,13 +1409,10 @@ class OverpassViewSet(viewsets.ViewSet):
# "tags": tags, # Include all raw tags for future use
}
# Filter out adventures with no meaningful data
if any([
adventure["name"],
adventure["latitude"],
adventure["longitude"],
]
) or all:
# Filter out adventures with no name, latitude, or longitude
if (adventure["name"] and
adventure["latitude"] is not None and -90 <= adventure["latitude"] <= 90 and
adventure["longitude"] is not None and -180 <= adventure["longitude"] <= 180) or all:
adventures.append(adventure)
return adventures