Skip to content
Snippets Groups Projects
Commit a5b446d9 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

fixup! Move the emailing into a celery task

parent 3f1bb376
No related branches found
No related tags found
No related merge requests found
...@@ -5,4 +5,4 @@ class ActivityConfig(AppConfig): ...@@ -5,4 +5,4 @@ class ActivityConfig(AppConfig):
name = 'opentech.apply.activity' name = 'opentech.apply.activity'
def ready(self): def ready(self):
from . import signals from . import signals # NOQA
...@@ -253,7 +253,7 @@ class EmailAdapter(AdapterBase): ...@@ -253,7 +253,7 @@ class EmailAdapter(AdapterBase):
def send_message(self, message, submission, subject, recipient, **kwargs): def send_message(self, message, submission, subject, recipient, **kwargs):
try: try:
emails_sent = send_mail( send_mail(
subject, subject,
message, message,
submission.page.specific.from_address, submission.page.specific.from_address,
......
from celery import Celery from celery import Celery
from django.conf import settings from django.conf import settings
from django.core.mail import send_mail as dj_send_mail
from django.core.mail import EmailMessage from django.core.mail import EmailMessage
app = Celery('tasks') app = Celery('tasks')
......
...@@ -41,4 +41,4 @@ class MessageFactory(factory.DjangoModelFactory): ...@@ -41,4 +41,4 @@ class MessageFactory(factory.DjangoModelFactory):
content = factory.Faker('sentence') content = factory.Faker('sentence')
recipient = factory.Faker('email') recipient = factory.Faker('email')
event = factory.SubFactory(EventFactory) event = factory.SubFactory(EventFactory)
external_id = factory.LazyFunction(lambda : '<{}>'.format(uuid.uuid4())) external_id = factory.LazyFunction(lambda: '<{}>'.format(uuid.uuid4()))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment