mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-03 23:48:12 +08:00
Avoid creating task run on Scheduler creation (#268)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user