]> git.0d.be Git - panikweb.git/commitdiff
work around a bug in grid
authorFrédéric Péters <fpeters@0d.be>
Sat, 21 Jul 2018 17:47:50 +0000 (19:47 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sat, 21 Jul 2018 17:47:50 +0000 (19:47 +0200)
panikweb/views.py

index d1a423aa19539793559057c38ff9ef7c277d23ef..611b427231e1e253779cd763b641779a4f22ed8d 100644 (file)
@@ -330,7 +330,10 @@ class Grid(TemplateView):
             for j in range(7):
                 grid[-1].append(TimeCell(i, j))
 
-            nonstop = [x for x in nonstops if i>=x[0]*2 and i<x[1]*2][0]
+            try:
+                nonstop = [x for x in nonstops if i>=x[0]*2 and i<x[1]*2][0]
+            except IndexError:
+                pass
             for time_cell in grid[-1]:
                 time_cell.nonstop = nonstop[2]
                 time_cell.nonstop_slug = nonstop[3]