send_email: Assert custom email payload is a str.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-04-29 16:46:32 -07:00
committed by Tim Abbott
parent 0dff5f0a27
commit 8b47b5dc34

View File

@@ -538,7 +538,9 @@ def custom_email_sender(
# First, we render the Markdown input file just like our
# user-facing docs with render_markdown_path.
with open(plain_text_template_path, "w") as f:
f.write(parsed_email_template.get_payload())
payload = parsed_email_template.get_payload()
assert isinstance(payload, str)
f.write(payload)
from zerver.lib.templates import render_markdown_path