From e78e6e6f224914406cfe3813be4e980c384c4897 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sat, 7 Sep 2019 15:06:40 +0200 Subject: [PATCH] fixed lower case problem --- lib/location.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/location.py b/lib/location.py index 39d0cfe..ec6d714 100644 --- a/lib/location.py +++ b/lib/location.py @@ -250,6 +250,8 @@ def location_processing(location, ip_addr): # here we resolve them if location is not None: # and not ascii_only(location): location = "~" + location.lstrip('~ ') + if not override_location_name: + override_location_name = location.lstrip('~') # if location is not None and location.upper() in IATA_CODES: # location = '~%s' % location @@ -257,7 +259,8 @@ def location_processing(location, ip_addr): if location is not None and location.startswith('~'): geolocation = geolocator(location_canonical_name(location[1:])) if geolocation is not None: - override_location_name = location[1:].replace('+', ' ') + if not override_location_name: + override_location_name = location[1:].replace('+', ' ') location = "%s,%s" % (geolocation['latitude'], geolocation['longitude']) country = None if not hide_full_address: @@ -267,6 +270,7 @@ def location_processing(location, ip_addr): else: location = NOT_FOUND_LOCATION #location[1:] + return location, \ override_location_name, \ full_address, \