From 48f4caf85a7d08ebedc434f7a424e307cfd99de4 Mon Sep 17 00:00:00 2001 From: Bekir Yenilmez Date: Mon, 4 Dec 2023 16:02:56 +0000 Subject: [PATCH] fix: do not reuse same instance for recipient Existing implementation uses same instance for all recipients, causing all sender/recipients to be the same email that is fetched the last. --- office365/outlook/mail/recipient.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/office365/outlook/mail/recipient.py b/office365/outlook/mail/recipient.py index beeafdcca..d2053a48a 100644 --- a/office365/outlook/mail/recipient.py +++ b/office365/outlook/mail/recipient.py @@ -5,10 +5,12 @@ class Recipient(ClientValue): """Represents information about a user in the sending or receiving end of an event, message or group post.""" - def __init__(self, email_address=EmailAddress()): + def __init__(self, email_address=None): """ :param EmailAddress email_address: The recipient's email address. """ + if email_address is None: + email_address = EmailAddress() super(Recipient, self).__init__() self.emailAddress = email_address