From d98d0e5b8216ec62d3afeca313f3ed09c7e6b4a3 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 8 Jun 2021 00:34:23 +0200 Subject: [PATCH] Separate mails --- elections/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/elections/utils.py b/elections/utils.py index ce8876c..90633e2 100644 --- a/elections/utils.py +++ b/elections/utils.py @@ -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"])