fixed lower case problem

This commit is contained in:
Igor Chubin 2019-09-07 15:06:40 +02:00
parent c8341c5d84
commit e78e6e6f22

View File

@ -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, \