Don't use function names like that _
On Fri, May 1, 2020, 20:03 Divash Singh <[email protected]> wrote:
> Hi guys,
>
>
>
> I am using Celery and Eventlet to facilitate a task which sends emails. I
> am using the following code:
>
>
>
> @task
>
> def order_created(order_id):
>
> """
>
> Task to send an e-mail notification when an order is
>
> successfully created.
>
> """
>
> order = Order.objects.get(id=order_id)
>
> subject = 'Order nr. {}'.format(order.id)
>
> message = 'Dear {},\n\nYou have successfully placed an order.\
>
> Your order id is {}.'.format(order.first_name,
>
> order.id)
>
> mail_sent =
> send_mail(subject,message,settings.EMAIL_HOST_USER,[order.email],fail_silently=False)
>
>
>
>
>
> return mail_sent
>
>
>
> I get the following error
>
>
>
> TypeError: wrap_socket() got an unexpected keyword argument '_context'
>
>
>
> Can anyone assist?
>
> I am using Python 3.8
>
> Celery 4.4.2
>
> Eventlet 0.25.2
>
> Django 2.2.12
>
>
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5eac332b.1c69fb81.a319b.4b21%40mx.google.com
> <https://groups.google.com/d/msgid/django-users/5eac332b.1c69fb81.a319b.4b21%40mx.google.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAGiJVX0pVKLfSkPpb%2BYA-UYkoSeJ9kKsWi4qjkOoVGiHD63QkA%40mail.gmail.com.