Utils: Finish ParsedEmail --> EmailAddress conversion

Within an EmailAddress (previously ParsedEmail object), properties
now match Python 3.6 email.headerregistry.Address naming:

* .email --> .addr_spec
* .name --> .display_name
* .localpart --> .username

(Completes work started in 386668908423d1d4eade90cf7a21a546a1e96514;
this updates remaining uses of old names and removes them.)
This commit is contained in:
medmunds
2017-10-27 17:53:13 -07:00
parent bb68f3dd6d
commit 9acf6501b5
10 changed files with 40 additions and 56 deletions

View File

@@ -69,9 +69,9 @@ class EmailBackend(AnymailRequestsBackend):
backend=self)
return {
recipient.email: AnymailRecipientStatus(
recipient.addr_spec: AnymailRecipientStatus(
message_id=message_id,
status=('rejected' if recipient.email.lower() in rejected_emails
status=('rejected' if recipient.addr_spec.lower() in rejected_emails
else default_status)
)
for recipient in payload.all_recipients