Commit e955049f authored by Patrick Kimber's avatar Patrick Kimber

Enquiry emails do not send immediately

- Wait for transaction to finish before sending emails

https://www.kbsoftware.co.uk/crm/ticket/3562/
parent 78095b4e
Pipeline #30523286 passed with stage
in 1 minute and 20 seconds
......@@ -3,6 +3,7 @@ import logging
from captcha.fields import ReCaptchaField
from django import forms
from django.db import transaction
from django.urls import reverse
from django.utils import timezone
......@@ -88,7 +89,7 @@ class EnquiryForm(RequiredFieldForm):
self._email_subject(instance),
self._email_message(instance),
)
process_mail.delay()
transaction.on_commit(lambda: process_mail.delay())
else:
logging.error(
"Enquiry app cannot send email notifications. "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment