Skip to content

Commit 486367e

Browse files
Merge branch 'master' of github.com:singleplatform-eng/django-celery-beat
2 parents 58e0292 + 4dd3826 commit 486367e

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.3.0
2+
current_version = 1.4.0
33
commit = True
44
tag = True
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<releaselevel>[a-z]+)?

Changelog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
Change history
55
================
66

7+
.. _version-1.4.0:
8+
9+
1.4.0
10+
=====
11+
:release-date: 2018-12-09 1:30 p.m. UTC+2:00
12+
:release-by: Omer Katz
13+
14+
- Fix migrations dependencies.
15+
- Added the DJANGO_CELERY_BEAT_TZ_AWARE setting.
16+
717
.. _version-1.3.0:
818

919
1.3.0

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
|build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
1010

11-
:Version: 1.3.0
11+
:Version: 1.4.0
1212
:Web: http://django-celery-beat.readthedocs.io/
1313
:Download: http://pypi.python.org/pypi/django-celery-beat
1414
:Source: http://github.com/celery/django-celery-beat

django_celery_beat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from collections import namedtuple
1212

13-
__version__ = '1.3.0'
13+
__version__ = '1.4.0+singleplatform.1'
1414
__author__ = 'Ask Solem'
1515
__contact__ = '[email protected]'
1616
__homepage__ = 'https://github.com/celery/django-celery-beat'

django_celery_beat/models.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ def __str__(self):
108108
)
109109

110110

111+
class TZNaiveSchedule(schedules.schedule):
112+
113+
def maybe_make_aware(self, dt):
114+
"""
115+
Overriding the base method, to be a no-op and returning the dt as is.
116+
"""
117+
return dt
118+
119+
111120
@python_2_unicode_compatible
112121
class IntervalSchedule(models.Model):
113122
"""Schedule executing every n seconds."""
@@ -134,10 +143,15 @@ class Meta:
134143

135144
@property
136145
def schedule(self):
137-
return schedules.schedule(
146+
_schedule = TZNaiveSchedule(
138147
timedelta(**{self.period: self.every}),
139-
nowfun=lambda: make_aware(now())
140148
)
149+
if getattr(settings, 'DJANGO_CELERY_BEAT_TZ_AWARE', True):
150+
_schedule = schedules.schedule(
151+
timedelta(**{self.period: self.every}),
152+
nowfun=lambda: make_aware(now())
153+
)
154+
return _schedule
141155

142156
@classmethod
143157
def from_schedule(cls, schedule, period=SECONDS):

docs/includes/introduction.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:Version: 1.3.0
1+
:Version: 1.4.0
22
:Web: http://django-celery-beat.readthedocs.io/
33
:Download: http://pypi.python.org/pypi/django-celery-beat
44
:Source: http://github.com/celery/django-celery-beat

0 commit comments

Comments
 (0)