Separate mails

This commit is contained in:
Tom Hubrecht 2021-06-08 00:34:23 +02:00
parent 1353c4e702
commit d98d0e5b82

View file

@ -8,7 +8,7 @@ from networkx.algorithms.dag import ancestors, descendants
from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import make_password
from django.core.exceptions import ValidationError
from django.core.mail import EmailMessage, get_connection
from django.core.mail import EmailMessage # , get_connection
from django.core.validators import validate_email
from django.template.loader import render_to_string
from django.urls import reverse
@ -403,5 +403,7 @@ def send_mail(election, mail_form):
to=[v.email],
)
)
get_connection(fail_silently=False).send_messages(messages)
# get_connection(fail_silently=False).send_messages(messages)
for m in messages:
m.send()
User.objects.bulk_update(voters, ["password"])