SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 1b4720e2 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Fix optional original_recipient sender

parent c664e3cf
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,10 @@ class MailUtilsMixin:
self.mail_template = mail_template.render(kwargs)
# Gather Recipients data
self.original_recipient = self._validate_single_entry(self.mail_data.get('to_address'))[0]
try:
self.original_recipient = self._validate_single_entry(self.mail_data.get('to_address'))[0]
except IndexError:
self.original_recipient = ''
self.subject = self.mail_data['subject']
......@@ -87,6 +90,8 @@ class MailUtilsMixin:
return mail_to
elif re.match("[^@]+@[^@]+\.[^@]+", entry):
return [entry]
else:
return []
def validate_bcc_list(self):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment