Opened 5 months ago

Closed 5 months ago

Last modified 3 months ago

#35537 closed Cleanup/optimization (fixed)

Use a namedtuple for email attachments and alternatives

Reported by: Sarah Boyce Owned by: Jake Howard
Component: Core (Mail) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Ticket to track: https://github.com/django/django/pull/18261

This makes unpacking the specific indexes more descriptive, whilst avoiding breaking any existing uses (since the field order hasn't changed).

email.alternatives[0][0]  # before
email.alternatives[0].content  #after

Change History (6)

comment:1 by Sarah Boyce, 5 months ago

Has patch: set

comment:2 by Jake Howard, 5 months ago

Triage Stage: UnreviewedAccepted

Yes, I definitely accept this ticket for a PR I created! 😝

comment:3 by Sarah Boyce, 5 months ago

Triage Stage: AcceptedReady for checkin

comment:4 by Sarah Boyce <42296566+sarahboyce@…>, 5 months ago

Resolution: fixed
Status: assignedclosed

In aba0e54:

Fixed #35537 -- Changed EmailMessage.attachments and EmailMultiAlternatives.alternatives to use namedtuples.

This makes it more descriptive to pull out the named fields.

comment:5 by Sarah Boyce <42296566+sarahboyce@…>, 4 months ago

In d5bebc1:

Refs #35537 -- Improved documentation and test coverage for email attachments and alternatives.

comment:6 by Sarah Boyce <42296566+sarahboyce@…>, 3 months ago

In 43cdfa8b:

Refs #35537 -- Clarified release notes for email attachments and alternatives changes.

Note: See TracTickets for help on using tickets.
Back to Top