Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

send_email: Move logging after dry-run abort.

Tim Abbottcde86fbaca99
diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.py
index d04320f4a14..016e4c1df8b 100644
--- a/zerver/lib/send_email.py
+++ b/zerver/lib/send_email.py
@@ -239,7 +239,6 @@ def send_email(
realm=realm,
)
template = template_prefix.split("/")[-1]
- logger.info("Sending %s email to %s", template, mail.to)
if dry_run:
print(mail.message().get_payload()[0])
@@ -248,6 +247,8 @@ def send_email(
if connection is None:
connection = get_connection()
+ logger.info("Sending %s email to %s", template, mail.to)
+
try:
# This will call .open() for us, which is a no-op if it's already open;
# it will only call .close() if it was not open to begin with