Skip to content

Commit 8eb41fd

Browse files
authored
Merge pull request #6834 from readthedocs/humitos/send-emails-no-template
Allow receiving `None` for `template_html` when sending emails
2 parents ef680d1 + 393b842 commit 8eb41fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

readthedocs/core/tasks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def send_email_task(
5656
get_template(template_html).render(context),
5757
'text/html',
5858
)
59-
except TemplateDoesNotExist:
59+
except (TypeError, TemplateDoesNotExist):
60+
# TypeError is raised when ``template_html`` is ``None``
6061
pass
6162
msg.send()
6263
log.info('Sent email to recipient: %s', recipient)

0 commit comments

Comments
 (0)