diff --git a/elections/utils.py b/elections/utils.py index 722372a..556f7a0 100644 --- a/elections/utils.py +++ b/elections/utils.py @@ -461,9 +461,8 @@ def send_mail(election: "Election", subject: str, body: str, reply_to: str) -> N for m, v in messages: try: m.send() + v.has_valid_email = True except smtplib.SMTPException: v.has_valid_email = False - else: - v.has_valid_email = True - User.objects.bulk_update(voters, ["password", "has_valid_email"]) + v.save()