mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-09-27 11:50:31 +00:00
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:
co-authored by
Claude Opus 5
parent
3130fc3a7c
commit
283e49b1ee
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user