forked from shaba/openuds
Fixed calendar actions
This commit is contained in:
parent
bbae1dca44
commit
e8698316c6
@ -232,7 +232,11 @@ class CalendarAction(UUIDModel):
|
|||||||
|
|
||||||
def save(self, force_insert=False, force_update=False, using=None, update_fields=None):
|
def save(self, force_insert=False, force_update=False, using=None, update_fields=None):
|
||||||
lastExecution = self.last_execution or getSqlDatetime()
|
lastExecution = self.last_execution or getSqlDatetime()
|
||||||
self.next_execution = calendar.CalendarChecker(self.calendar).nextEvent(checkFrom=lastExecution-self.offset, startEvent=self.at_start) + self.offset
|
possibleNext = calendar.CalendarChecker(self.calendar).nextEvent(checkFrom=lastExecution-self.offset, startEvent=self.at_start)
|
||||||
|
if possibleNext:
|
||||||
|
self.next_execution = possibleNext + self.offset
|
||||||
|
else:
|
||||||
|
self.next_execution = None
|
||||||
|
|
||||||
super().save(force_insert, force_update, using, update_fields)
|
super().save(force_insert, force_update, using, update_fields)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user