Commit 3701477a authored by fred's avatar fred

consider weeks when calculating same-day reruns

parent 76bde5ff
......@@ -185,7 +185,9 @@ class EpisodeNewForm(EpisodeForm):
def get_diffusion_fields(self, emission):
if emission:
schedules = list(Schedule.objects.filter(emission=emission).order_by('datetime'))
if len(schedules) > 1 and schedules[0].datetime.date() == schedules[1].datetime.date():
if len(schedules) > 1 and (
schedules[0].weeks == schedules[1].weeks and
schedules[0].datetime.date() == schedules[1].datetime.date()):
# special case for daily program with same-day rerun
schedules = 2
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment