Match get_mailbox annotations to what callers actually pass

get_mailbox declared port and security as always-present types, but
MailAccount.imap_port is nullable and imap_security is stored as a plain
integer, so type checking flagged every call site as passing the wrong
type.

Widen the annotations to port: int | None and security: int, matching the
model fields; IntegerChoices members still compare equal to plain ints, so
the existing branching in get_mailbox is unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
stumpylog
2026-09-22 12:49:05 -07:00
co-authored by Claude Opus 5
parent 3130fc3a7c
commit 283e49b1ee
+2 -2
View File
@@ -533,8 +533,8 @@ class PinnedMailBoxStartTls(PinnedClientMixin, MailBoxStartTls):
def get_mailbox(
server: str,
port: int,
security: MailAccount.ImapSecurity,
port: int | None,
security: int,
) -> MailBox:
"""
Returns the correct MailBox instance for the given configuration.