From fa59573a653cf6b4f7c8a63b085997f2faa98073 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 3 Dec 2018 16:28:39 -0800 Subject: [PATCH] mypy: Fix mypy errors in send_email logic. mypy should be able to figure this out given the xor just above, but it's not surprising that it doesn't. --- zerver/lib/send_email.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.py index c105fe208f..0d2e12366a 100644 --- a/zerver/lib/send_email.py +++ b/zerver/lib/send_email.py @@ -138,6 +138,7 @@ def send_future_email(template_prefix: str, realm: Realm, to_user_ids: Optional[ assert(UserProfile.objects.filter(id__in=to_user_ids, realm=realm).exists()) to_field = {'user_id': to_user_ids[0]} # type: Dict[str, Any] else: + assert to_emails is not None assert(len(to_emails) == 1) to_field = {'address': parseaddr(to_emails[0])[1]}