From 393b842adc4099747d3a08cf5513fac67bbcf63a Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 30 Mar 2020 15:48:47 +0200 Subject: [PATCH] Allow receiving `None` for `template_html` when sending emails We are using this internally and we haven't receiving emails in the last month or so. I suppose this started happening after the Django 2.2 migration. --- readthedocs/core/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readthedocs/core/tasks.py b/readthedocs/core/tasks.py index 7c1b86f477f..6969b619e0a 100644 --- a/readthedocs/core/tasks.py +++ b/readthedocs/core/tasks.py @@ -56,7 +56,8 @@ def send_email_task( get_template(template_html).render(context), 'text/html', ) - except TemplateDoesNotExist: + except (TypeError, TemplateDoesNotExist): + # TypeError is raised when ``template_html`` is ``None`` pass msg.send() log.info('Sent email to recipient: %s', recipient)