]> git.0d.be Git - panikweb.git/commitdiff
Debug program
authorlaron <simon@surlaterre.org>
Fri, 30 Aug 2013 14:12:29 +0000 (16:12 +0200)
committerlaron <simon@surlaterre.org>
Fri, 30 Aug 2013 14:12:29 +0000 (16:12 +0200)
panikweb/views.py

index 240f5366c3d60813890e86145e5fe8362c36954a..097b3dc0d3a6d949c3c9a2a45ca0521a998b36d1 100644 (file)
@@ -97,17 +97,14 @@ class ProgramView(TemplateView):
         context = super(ProgramView, self).get_context_data(**kwargs)
         context['sectionName'] = "emissions"
         schedules = Schedule.objects.select_related().order_by('datetime')
-        week = int(week)
-        year = int(year)
         days = []
         for day in range(7):
             days.append({'schedules': [x for x in schedules if x.is_on_weekday(day+1)],
                          'datetime': datetime(2007, 1, day+1)})
         context['days'] = days
         context['weekday'] = datetime.today().weekday()
-        context['week'] = week if week is not None else datetime.today().isocalendar()[1]-1
-        context['week'] = week if week is not None else datetime.today().isocalendar()[1]-1
-        context['year'] = year if year is not None else datetime.today().year
+        context['week'] = week = int(week) if week is not None else datetime.today().isocalendar()[1]-1
+        context['year'] = year = int(year) if year is not None else datetime.today().year
         context['week_first_day'] = datetime.strptime(str(year)+' '+str(week)+' 1', '%Y %U %w')
         context['week_last_day'] = context['week_first_day'] + timedelta(days=+6)
         context['week_previous'] =  context['week_first_day'] + timedelta(days=-7)