More ruff linter fixes

This commit is contained in:
Ian Renton
2026-08-15 08:43:19 +01:00
parent dd89ff4af7
commit a6e54f524d
43 changed files with 99 additions and 153 deletions
+3 -3
View File
@@ -153,7 +153,7 @@ def get_spot_list_with_filters(all_spots, query):
spots.append(s)
spots = sorted(spots, key=lambda spot: spot.time if spot and spot.time else 0, reverse=True)
spots = list(filter(lambda spot: spot_allowed_by_query(spot, query), spots))
if "limit" in query.keys():
if "limit" in query:
spots = spots[: int(query.get("limit"))]
# Ensure only the latest spot of each callsign-SSID combo is present in the list. This relies on the
@@ -163,7 +163,7 @@ def get_spot_list_with_filters(all_spots, query):
# This is a special consideration for the geo map and band map views (and Field Spotter) because while
# duplicates are fine in the main spot list (e.g. different cluster spots of the same DX) this doesn't
# work well for the other views.
if "dedupe" in query.keys():
if "dedupe" in query:
dedupe = query.get("dedupe").upper() == "TRUE"
if dedupe:
spots_temp = []
@@ -182,7 +182,7 @@ def spot_allowed_by_query(spot, query):
"""Given URL query params and a spot, figure out if the spot "passes" the requested filters or is rejected. The list
of query parameters and their function is defined in the API docs."""
for k in query.keys():
for k in query:
match k:
case "since":
since = datetime.fromtimestamp(int(query.get(k)), pytz.UTC).timestamp()