From db7eda85cf8f9fb6d648467651901c41036e2ef5 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Wed, 14 Feb 2018 23:42:01 -0200 Subject: [PATCH] Cleanup minor bugs from new homepage --- events/views.py | 2 +- get_together/templates/get_together/index.html | 2 +- get_together/views/__init__.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/events/views.py b/events/views.py index a1a5833..861d015 100644 --- a/events/views.py +++ b/events/views.py @@ -71,7 +71,7 @@ def city_list(request, *args, **kwargs): if "spr" in request.GET and request.GET.get("spr") is not "": cities = cities.filter(spr=request.GET.get("spr")) - serializer = CitySerializer(cities[:20], many=True) + serializer = CitySerializer(cities[:50], many=True) return Response(serializer.data) @api_view(['GET']) diff --git a/get_together/templates/get_together/index.html b/get_together/templates/get_together/index.html index def926d..f81b177 100644 --- a/get_together/templates/get_together/index.html +++ b/get_together/templates/get_together/index.html @@ -26,7 +26,7 @@
{% if geoip_lookup or city_search %} diff --git a/get_together/views/__init__.py b/get_together/views/__init__.py index 80d209f..e47430e 100644 --- a/get_together/views/__init__.py +++ b/get_together/views/__init__.py @@ -51,12 +51,12 @@ def home(request, *args, **kwards): client_ip = get_client_ip(request) if client_ip == '127.0.0.1' or client_ip == 'localhost': if settings.DEBUG: - client_ip = '189.122.101.2' # Try Google's server + client_ip = '8.8.8.8' # Try Google's server else: raise Exception("Client is localhost") g = geocoder.ip(client_ip) - if g.latlng[0] is not None and g.latlng[1] is not None: + if g.latlng is not None and g.latlng[0] is not None and g.latlng[1] is not None: ll = g.latlng context['geoip_lookup'] = True except Exception as err: