Opened 4 years ago

Closed 4 years ago

#31574 closed Bug (worksforme)

EmailMessage.cc/to/bcc cannot mix tuples and lists as arguments.

Reported by: Joe Huang Owned by: nobody
Component: Core (Mail) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Joe Huang)

EmailMessage has fields to, cc, and bcc that can be either tuples or lists. However, mixing tuples and lists errors at this method:

def recipients(self):
    return [email for email in (self.to + self.cc + self.bcc) if email]

Lists and tuples can't be added together.

Change History (2)

comment:1 by Joe Huang, 4 years ago

Description: modified (diff)

comment:2 by Mariusz Felisiak, 4 years ago

Resolution: worksforme
Status: newclosed
Summary: BUG: EmailMessage cannot mix tuples and lists as argumentsEmailMessage.cc/to/bcc cannot mix tuples and lists as arguments.
Version: 3.0master

Mixing list and tuples works for me. We cast them to lists in EmailMessage.__init__().

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