mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
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:
@@ -232,22 +232,6 @@ class EmailAddress(object):
|
||||
def __str__(self):
|
||||
return self.address
|
||||
|
||||
# Deprecated property names from old ParsedEmail (don't use in new code!)
|
||||
@property
|
||||
def name(self):
|
||||
return self.display_name
|
||||
|
||||
@property
|
||||
def email(self):
|
||||
return self.addr_spec
|
||||
|
||||
@property
|
||||
def localpart(self):
|
||||
return self.username
|
||||
|
||||
|
||||
ParsedEmail = EmailAddress # deprecated class name (don't use!)
|
||||
|
||||
|
||||
class Attachment(object):
|
||||
"""A normalized EmailMessage.attachments item with additional functionality
|
||||
|
||||
Reference in New Issue
Block a user