Skip to content

Commit

Permalink
Merge pull request #46 from belyak/celery-detection-python3-bugfix
Browse files Browse the repository at this point in the history
Celery detection python3 bugfix
  • Loading branch information
gotlium committed Jan 7, 2016
2 parents 6f016a3 + 7e2691e commit b9c8004
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ Django-Db-Mailer
.. image:: https://landscape.io/github/LPgenerator/django-db-mailer/master/landscape.svg
:target: https://landscape.io/github/LPgenerator/django-db-mailer/master
:alt: Code Health
.. image:: https://img.shields.io/badge/python-2.6,2.7,pypy,3.4,pypy3-blue.svg
:alt: Python 2.6, 2.7, pypy,3.4,pypy3
.. image:: https://api.codacy.com/project/badge/grade/ad1442e15215494499ed08b80d4c41c5
:target: https://www.codacy.com/app/gotlium/django-db-mailer
:alt: Codacy
.. image:: https://img.shields.io/badge/python-2.6,2.7,3.4+,pypy,pypy3-blue.svg
:alt: Python 2.6, 2.7, 3.4+, pypy, pypy3
:target: https://pypi.python.org/pypi/django-db-mailer/
.. image:: https://img.shields.io/pypi/v/django-db-mailer.svg
:alt: Current version on PyPi
:target: https://crate.io/packages/django-db-mailer/
:target: https://pypi.python.org/pypi/django-db-mailer/
.. image:: https://img.shields.io/pypi/dm/django-db-mailer.svg
:alt: Downloads from PyPi
:target: https://crate.io/packages/django-db-mailer/
:target: https://pypi.python.org/pypi/django-db-mailer/
.. image:: https://readthedocs.org/projects/django-db-mailer/badge/?version=latest
:target: http://django-db-mailer.readthedocs.org/
:alt: Documentation Status
Expand Down
6 changes: 3 additions & 3 deletions dbmail/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def app_installed(app):

def celery_supported():
try:
import tasks
from dbmail import tasks

if not app_installed('djcelery'):
raise ImportError
Expand All @@ -43,7 +43,7 @@ def db_sender(slug, recipient, *args, **kwargs):
backend = kwargs.get('backend', BACKEND['mail'])

if celery_supported() and use_celery is True:
import tasks
import dbmail.tasks

template = MailTemplate.get_template(slug=slug)
max_retries = kwargs.get('max_retries', None)
Expand All @@ -63,7 +63,7 @@ def db_sender(slug, recipient, *args, **kwargs):
if send_after is not None:
options.update({'countdown': send_after})
if template.is_active:
return tasks.db_sender.apply_async(**options)
return dbmail.tasks.db_sender.apply_async(**options)
else:
module = import_module(backend)
if DEBUG is True:
Expand Down

0 comments on commit b9c8004

Please sign in to comment.