summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2012-12-16 19:03:14 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2012-12-16 19:03:14 (GMT)
commit763d8a04a87ce110ead286f71a34142ccc8ff041 (patch)
tree4164d6accc4464fb6fa258d13a70e177a67cfb79 /program
parentd05a248aa90ee1a1936dc86a9a7b5b2c827585e9 (diff)
avoided case when len(ends) < len(starts).
Diffstat (limited to 'program')
-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])