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.
This commit is contained in:
Tim Abbott
2018-12-03 16:28:39 -08:00
parent c21a05a3b1
commit fa59573a65

View File

@@ -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]}