Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug when dt is None #35

Merged
merged 2 commits into from
Aug 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- '3.4'
- '3.6'
install: pip install tox-travis codecov==2.0.5
script: tox
deploy:
Expand Down
4 changes: 2 additions & 2 deletions django_apscheduler/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ def serialize_dt(dt):
:param dt:
:return:
"""
if not settings.USE_TZ and is_aware(dt):
if not settings.USE_TZ and dt and is_aware(dt):
return make_naive(dt)
return dt


def deserialize_dt(dt):
if not settings.USE_TZ and is_naive(dt):
if not settings.USE_TZ and dt and is_naive(dt):
return make_aware(dt)
return dt