Avoid creating task run on Scheduler creation (#268)

This commit is contained in:
Fernando Karchiloff
2025-03-12 23:31:00 +01:00
committed by GitHub
parent 81f2531e3e
commit a154fd658a
2 changed files with 47 additions and 0 deletions
+6
View File
@@ -302,6 +302,12 @@ class Schedule(models.Model):
def __str__(self):
return self.func
def save(self, *args, **kwargs):
if self.pk is None and self.schedule_type == self.CRON:
self.next_run = self.calculate_next_run()
return super().save(*args, **kwargs)
success.boolean = True
success.short_description = _("success")
last_run.allow_tags = True