From f4faa4c336bb28f6c6609c459d99b7774efd2d04 Mon Sep 17 00:00:00 2001 From: Lars Lehmann <33843261+larsl-net@users.noreply.github.com> Date: Sun, 28 Dec 2025 18:57:15 +0100 Subject: [PATCH] Reorder town and county checks in geocoding.py Fix detection if only town exists for a location but county is no city name --- backend/server/adventures/geocoding.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/server/adventures/geocoding.py b/backend/server/adventures/geocoding.py index 86aab82b..b5afe7ff 100644 --- a/backend/server/adventures/geocoding.py +++ b/backend/server/adventures/geocoding.py @@ -157,10 +157,10 @@ def extractIsoCode(user, data): for key in keys: if key.find("ISO") != -1: iso_code = data['address'][key] - if 'town' in keys: - town_city_or_county = data['address']['town'] if 'county' in keys: town_city_or_county = data['address']['county'] + if 'town' in keys: + town_city_or_county = data['address']['town'] if 'city' in keys: town_city_or_county = data['address']['city'] if not iso_code: @@ -274,4 +274,4 @@ def _parse_google_address_components(components): if country_code and state_code: parsed["ISO3166-2-lvl1"] = f"{country_code}-{state_code}" - return parsed \ No newline at end of file + return parsed