Skip to content

Commit a32001a

Browse files
Override maybe_make_aware in crontab schedule
1 parent 486367e commit a32001a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

django_celery_beat/models.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ def maybe_make_aware(self, dt):
117117
return dt
118118

119119

120+
class TZNaiveCronSchedule(schedules.crontab):
121+
122+
def maybe_make_aware(self, dt):
123+
"""
124+
Overriding the base method, to be a no-op and returning the dt as is.
125+
"""
126+
return dt
127+
128+
120129
@python_2_unicode_compatible
121130
class IntervalSchedule(models.Model):
122131
"""Schedule executing every n seconds."""
@@ -225,7 +234,7 @@ def __str__(self):
225234

226235
@property
227236
def schedule(self):
228-
crontab = schedules.crontab(
237+
crontab = TZNaiveCronSchedule(
229238
minute=self.minute,
230239
hour=self.hour,
231240
day_of_week=self.day_of_week,

0 commit comments

Comments
 (0)