From: Frédéric Péters Date: Wed, 8 Jul 2020 07:02:15 +0000 (+0200) Subject: home: avoid program display crash if first (or last) slot is current (?) X-Git-Tag: v2021~159 X-Git-Url: https://git.0d.be/?p=panikdb.git;a=commitdiff_plain;h=a8ce92e97f154e36dba01463f7b46bb1a33a3075 home: avoid program display crash if first (or last) slot is current (?) --- diff --git a/panikdb/views.py b/panikdb/views.py index 6ad35f0..6d0141b 100644 --- a/panikdb/views.py +++ b/panikdb/views.py @@ -226,7 +226,7 @@ class Program(TemplateView): x.klass = x.__class__.__name__ previous_prog = None for i, x in enumerate(context['today_program']): - if x.datetime > now: + if x.datetime > now and previous_prog: previous_prog.now = True break previous_prog = x