-
-
Notifications
You must be signed in to change notification settings - Fork 522
fix: allow EmailMultiAlternatives in outbox
#2922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: allow EmailMultiAlternatives in outbox
#2922
Conversation
|
On another note, I'm not sure |
| ) -> None: ... | ||
|
|
||
| outbox: list[EmailMessage] | ||
| outbox: list[EmailMessage | EmailMultiAlternatives] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Sequence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Co-authored-by: sobolevn <mail@sobolevn.me>
This comment has been minimized.
This comment has been minimized.
|
Sorry, my suggestion was not correct. Let's revert this |
sobolevn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
According to the Django docs on sending email the
outboxattribute is:When you send single-message emails, they are direct instances of
EmailMessage. When the emails are multipart, they are instances ofEmailMultiAlternatives. WhileEmailMultiAlternativesinherits fromEmailMessage, declaringoutboxaslist[EmailMessageis only partially correct, because theEmailMultiAlternativesintroduces some properties and methods of its own, such asalternatives. If you access any of them, the type checker will complain. I think, thus, the correct type is: