From 1f9d772e8850d551b7fd599581da7b1532c54084 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 2 Feb 2013 16:12:40 +0100 Subject: [PATCH] While in demo mode, prevent from loading map with default center --- umap/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/umap/views.py b/umap/views.py index 517081e2..48116747 100644 --- a/umap/views.py +++ b/umap/views.py @@ -2,10 +2,12 @@ from django.views.generic import TemplateView from django.contrib.auth.models import User from django.views.generic import DetailView from django.db.models import Q +from django.contrib.gis.measure import D from sesql.shortquery import shortquery from leaflet_storage.models import Map +from leaflet_storage.forms import DEFAULT_CENTER class Home(TemplateView): @@ -13,11 +15,9 @@ class Home(TemplateView): list_template_name = "leaflet_storage/map_list.html" def get_context_data(self, **kwargs): - maps = Map.objects.order_by('-modified_at')[:100] - users = User.objects.filter(is_staff=False)[:10] + maps = Map.objects.filter(center__distance_gt=(DEFAULT_CENTER, D(km=1))).order_by('-modified_at')[:50] return { "maps": maps, - "users": users } def get_template_names(self):