def ready(self): from post_office import tasks from post_office.settings import get_celery_enabled from post_office.signals import email_queued if get_celery_enabled(): email_queued.connect(tasks.queued_mail_handler)
def ready(self): from post_office.signals import email_queued try: queued_mail_handler = import_string( 'post_office.tasks.queued_mail_handler') email_queued.connect(queued_mail_handler) except ImportError: pass # Celery is not installed
def ready(self): from actstream import registry registry.register(self.get_model('Email')) registry.register(self.get_model('EmailTemplate')) from post_office import tasks from post_office.signals import email_queued if hasattr(tasks, 'queued_mail_handler'): email_queued.connect(tasks.queued_mail_handler)
def ready(self): from post_office import tasks from post_office.signals import email_queued if hasattr(tasks, 'queued_mail_handler'): email_queued.connect(tasks.queued_mail_handler)