]> git.0d.be Git - django-panik-nonstop.git/commitdiff
stats: ignore disabled nonstop zones
authorFrédéric Péters <fpeters@0d.be>
Sun, 12 Jul 2020 15:25:26 +0000 (17:25 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 12 Jul 2020 15:25:26 +0000 (17:25 +0200)
nonstop/views.py

index ad1c45986f2d4f88d57756763b5fedb995211954..20314407ec13dfed273629e3b86ae70baae24676 100644 (file)
@@ -159,7 +159,7 @@ class StatisticsView(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(StatisticsView, self).get_context_data(**kwargs)
-        context['zones'] = Nonstop.objects.all().order_by('start')
+        context['zones'] = [x for x in Nonstop.objects.all().order_by('start') if x.start != x.end]
         kwargs = {}
         if 'from' in self.request.GET:
             kwargs['from_date'] = parse_date(self.request.GET['from'])