]> git.0d.be Git - panikweb.git/blobdiff - panikweb/views.py
return a 404 error for invalid week numbers
[panikweb.git] / panikweb / views.py
index 1dabe94a1c0a58a144a818891860c021add2a85c..0c386eb50def9be8628a4d39d34811013d4e2d9e 100644 (file)
@@ -285,6 +285,8 @@ class ProgramView(TemplateView):
 
         context['week'] = week = int(week) if week is not None else datetime.today().isocalendar()[1]
         context['year'] = year = int(year) if year is not None else datetime.today().isocalendar()[0]
+        if context['week'] > 53:
+            raise Http404()
         context['week_first_day'] = utils.tofirstdayinisoweek(year, week)
         context['week_last_day'] = context['week_first_day'] + timedelta(days=6)