1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-25 23:21:41 +03:00

Fixed calendar actions

This commit is contained in:
Adolfo Gómez García 2020-05-26 18:34:40 +02:00
parent 06f4c933ed
commit a7b33bb992

View File

@ -222,7 +222,8 @@ class CalendarAction(UUIDModel):
self.service_pool.save()
def save(self, force_insert=False, force_update=False, using=None, update_fields=None):
self.next_execution = calendar.CalendarChecker(self.calendar).nextEvent(checkFrom=self.last_execution, startEvent=self.at_start, offset=self.offset)
lastExecution = self.last_execution or getSqlDatetime()
self.next_execution = calendar.CalendarChecker(self.calendar).nextEvent(checkFrom=lastExecution-self.offset, startEvent=self.at_start) + self.offset
super().save(force_insert, force_update, using, update_fields)