BraydenMoore commited on
Commit
7637822
1 Parent(s): d4b2db6

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -42,7 +42,7 @@ def get_location(ip):
42
  geolite2.close()
43
  if location and 'location' in location:
44
  return {'country': location['country']['names']['en'],
45
- 'city': location['city']['names']['en'] if 'city' in location,
46
  'region': location['subdivisions'][0]['names']['en'] if len(location['subdivisions'])>0 else '',
47
  'loc': str(location['location']['longitude']) + ',' + str(location['location']['latitude']),
48
  'timezone': location['location']['time_zone']}
 
42
  geolite2.close()
43
  if location and 'location' in location:
44
  return {'country': location['country']['names']['en'],
45
+ 'city': location['city']['names']['en'] if 'city' in location else '',
46
  'region': location['subdivisions'][0]['names']['en'] if len(location['subdivisions'])>0 else '',
47
  'loc': str(location['location']['longitude']) + ',' + str(location['location']['latitude']),
48
  'timezone': location['location']['time_zone']}