From 2216064824a50319d09578d5fdc27abf7509916a Mon Sep 17 00:00:00 2001 From: Jack Shendrikov Date: Fri, 23 Apr 2021 17:51:37 +0300 Subject: [PATCH] Fix name of json key --- ip_locator/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip_locator/views.py b/ip_locator/views.py index 6468c9f..98e6a35 100644 --- a/ip_locator/views.py +++ b/ip_locator/views.py @@ -51,7 +51,7 @@ def analyze_api(data_apis): keys2_replace = ['city', 'regionName', 'lat', 'lon', 'isp', 'timezone'] if (data_apis[0]['country'] == data_apis[1]['country'] and data_apis[0]['city'] == data_apis[1]['city']) \ - or (data_apis[0]['country'] == data_apis[2]['country'] and data_apis[0]['city'] == data_apis[2]['city']): + or (data_apis[0]['country'] == data_apis[2]['country_name'] and data_apis[0]['city'] == data_apis[2]['city']): # check equality of lng, lat from API1 and API3 if int(data_apis[0]['latitude']) == int(data_apis[2]['latitude']) \ and int(data_apis[0]['longitude']) == int(data_apis[2]['longitude']):