-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
Fixed #35537 -- Use a namedtuple for email attachments and alternatives #18261
Fixed #35537 -- Use a namedtuple for email attachments and alternatives #18261
Conversation
In #18279, I added some docs for |
0ff77cf
to
fe96dfa
Compare
fe96dfa
to
bfc5492
Compare
bfc5492
to
dbad08e
Compare
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.
Nice! Have a last couple thoughts
Also in the 5.2 release notes, let's add something like
Email
~~~~~
* Tuple items of ``attachments`` of :class:`~django.core.mail.EmailMessage`
and :class:`~django.core.mail.EmailMultiAlternatives` are now named tuples,
as opposed to regular tuples.
* :attr:`EmailMultiAlternatives.alternatives
<django.core.mail.EmailMultiAlternatives.alternatives>` is now a list of
named tuples, as opposed to regular tuples.
cfa88f7
to
d1005ff
Compare
d1005ff
to
b259d57
Compare
b259d57
to
08c6475
Compare
08c6475
to
4072699
Compare
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.
Thank you 🥳 this looks good to me
…atives.alternatives to use namedtuples. This makes it more descriptive to pull out the named fields.
4072699
to
4a3d3f4
Compare
This makes it more descriptive to pull out the named fields
Trac ticket number
ticket-35537
Branch description
This change replaces the opaque tuples used for email attachments and alternatives with named tuples. This makes unpacking the specific indexes more descriptive, whilst avoiding breaking any existing uses (since the field order hasn't changed).
Unpacking the alternatives doesn't seem to be documented, so there are no docs to update. Similarly, adding attachments / alternatives is done using documented methods, whose public API is unaffected by this change. Manual insertion into the
.alternatives
and.attachments
may now fail, however users should be using the documented API methods.Checklist
main
branch.