AC-1182 Handle a schedule rrule that results in zero occurrences.

This commit is contained in:
Chris Church
2014-04-15 13:24:06 -04:00
parent fd1e35c6d9
commit e8b0d7451e
2 changed files with 6 additions and 2 deletions

View File

@@ -93,7 +93,10 @@ class Schedule(CommonModel):
next_run_actual = future_rs.after(now())
self.next_run = next_run_actual
self.dtstart = future_rs[0]
try:
self.dtstart = future_rs[0]
except IndexError:
self.dtstart = None
self.dtend = None
if 'until' in self.rrule.lower():
match_until = re.match(".*?(UNTIL\=[0-9]+T[0-9]+Z)", self.rrule)