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: Define variable typed as a Union.

Zixuan James Li75df60bd467e
diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.py
index 0bc5f9c1301..f53ab0f80cf 100644
--- a/zerver/lib/send_email.py
+++ b/zerver/lib/send_email.py
@@ -7,7 +7,7 @@ from email.headerregistry import Address
from email.parser import Parser
from email.policy import default
from email.utils import formataddr, parseaddr
-from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple
+from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple, Union
import backoff
import orjson
@@ -266,7 +266,7 @@ def send_email(
if request is not None:
cause = f" (triggered from {request.META['REMOTE_ADDR']})"
- logging_recipient = mail.to
+ logging_recipient: Union[str, List[str]] = mail.to
if realm is not None:
logging_recipient = f"{mail.to} in {realm.string_id}"