Skip to content

Commit

Permalink
Fix 127.0.0.1 None locations
Browse files Browse the repository at this point in the history
This commit fixes the problem of getting the GPS coordinates from gic.record_By_addr
when the IP is 127.0.0.1 and returns None.
  • Loading branch information
teleyinex committed Aug 1, 2013
1 parent 5aabe3d commit 6c61f7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pybossa/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ def stats_format_users(app_id, users, anon_users, auth_users, geo=False):
loc = gic.record_by_addr(u[0])
else:
loc = {}
if loc is None:
loc = {}
if (len(loc.keys()) == 0):
loc['latitude'] = 0
loc['longitude'] = 0
Expand All @@ -332,6 +334,8 @@ def stats_format_users(app_id, users, anon_users, auth_users, geo=False):
loc = gic.record_by_addr(u[0])
else:
loc = {}
if loc is None:
loc = {}
if (len(loc.keys()) == 0):
loc['latitude'] = 0
loc['longitude'] = 0
Expand Down

0 comments on commit 6c61f7e

Please sign in to comment.