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 # here we resolve them
if location is not None: # and not ascii_only(location): if location is not None: # and not ascii_only(location):
location = "~" + location.lstrip('~ ') location = "~" + location.lstrip('~ ')
if not override_location_name:
override_location_name = location.lstrip('~')
# if location is not None and location.upper() in IATA_CODES: # if location is not None and location.upper() in IATA_CODES:
# location = '~%s' % location # location = '~%s' % location
@ -257,7 +259,8 @@ def location_processing(location, ip_addr):
if location is not None and location.startswith('~'): if location is not None and location.startswith('~'):
geolocation = geolocator(location_canonical_name(location[1:])) geolocation = geolocator(location_canonical_name(location[1:]))
if geolocation is not None: 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']) location = "%s,%s" % (geolocation['latitude'], geolocation['longitude'])
country = None country = None
if not hide_full_address: if not hide_full_address:
@ -267,6 +270,7 @@ def location_processing(location, ip_addr):
else: else:
location = NOT_FOUND_LOCATION #location[1:] location = NOT_FOUND_LOCATION #location[1:]
return location, \ return location, \
override_location_name, \ override_location_name, \
full_address, \ full_address, \