Merge pull request #1509 from mozilla/fixup_geoip

Add conditional for None in geoip plugin
This commit is contained in:
A Smith 2019-10-28 14:12:24 -05:00 коммит произвёл GitHub
Родитель b6843d6765 bf804f9ba0
Коммит d5c0d0dde6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -56,8 +56,8 @@ class message(object):
message['details'][geo_key] = self.ipLocation(ipText)
# Add a geo_point coordinates if latitude and longitude exist
if 'latitude' in message['details'][geo_key] and 'longitude' in message['details'][geo_key]:
if message['details'][geo_key]['latitude'] != '' and message['details'][geo_key]['latitude'] != 'None' and \
message['details'][geo_key]['longitude'] != '' and message['details'][geo_key]['latitude'] != 'None':
if message['details'][geo_key]['latitude'] and message['details'][geo_key]['latitude'] != '' and \
message['details'][geo_key]['longitude'] and message['details'][geo_key]['longitude'] != '':
geopoint_key = '{0}ipgeopoint'.format(key)
message['details'][geopoint_key] = '{0},{1}'.format(
message['details'][geo_key]['latitude'],