From 236036a622bab60d301c9835b27adfe68353d81f Mon Sep 17 00:00:00 2001
From: tobiasdybdahl
Date: Sun, 11 May 2025 19:04:35 +0200
Subject: [PATCH] When automatically disables task, remeber to set no_changes =
False
---
django_celery_beat/schedulers.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/django_celery_beat/schedulers.py b/django_celery_beat/schedulers.py
index 063aaaa3..6a2d28b1 100644
--- a/django_celery_beat/schedulers.py
+++ b/django_celery_beat/schedulers.py
@@ -133,7 +133,9 @@ def is_due(self):
if self.model.expires is not None:
now = self._default_now()
if now >= self.model.expires:
- self._disable(self.model)
+ self.model.no_changes = False
+ self.model.enabled = False
+ self.model.save()
# Don't recheck
return schedules.schedstate(False, NEVER_CHECK_TIMEOUT)
|