Skip to content

Commit

Permalink
Merge pull request #9 from ebmdatalab/encoding-errors
Browse files Browse the repository at this point in the history
Skip encoding errors
  • Loading branch information
ccunningham101 committed Jan 12, 2024
2 parents cc1a892 + b887256 commit 8051c21
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions retractions/management/commands/send_retraction_emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,18 @@ def _get_mail_to_send(self, author, intervention_pairs):
(author_alias.full_name(), self.test_email)
)
else:
to_email = email.utils.formataddr(
(
author_alias.full_name(),
author_alias.email_address,
try:
to_email = email.utils.formataddr(
(
author_alias.full_name(),
author_alias.email_address,
)
)
)
except UnicodeEncodeError:
logging.warning(
"Skipping %s, invalid ascii", author_alias.email_address
)
continue
to_emails.append(to_email)

# If no emails to send to, skip this author
Expand Down

0 comments on commit 8051c21

Please sign in to comment.