summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/program/models.py b/program/models.py
index bac192c..8d415b8 100644
--- a/program/models.py
+++ b/program/models.py
@@ -228,10 +228,10 @@ class ProgramSlot(models.Model):
byweekday=byweekday_end))
if not old:
- for k in range(len(starts)):
+ for k in range(min(len(starts), len(ends))):
timeslot = TimeSlot.objects.create(programslot=self, start=starts[k], end=ends[k])
elif self.until > old.until:
- for k in range(len(starts)):
+ for k in range(min(len(starts), len(ends))):
if starts[k].date() > old.until:
timeslot = TimeSlot.objects.create(programslot=self, start=starts[k], end=ends[k])