From 117eb6576df5fefb36adce8c2cd4870798b37364 Mon Sep 17 00:00:00 2001 From: Ombental <30341654+Ombental@users.noreply.github.com> Date: Sat, 28 Nov 2020 17:57:21 +0200 Subject: [PATCH 1/3] Update calendar.py --- O365/calendar.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/O365/calendar.py b/O365/calendar.py index b853530f..2f5301c9 100644 --- a/O365/calendar.py +++ b/O365/calendar.py @@ -81,7 +81,10 @@ class EventAttachment(BaseAttachment): class EventAttachments(BaseAttachments): - _endpoints = {'attachments': '/events/{id}/attachments'} + _endpoints = { + 'attachments': '/events/{id}/attachments', + 'attachment': '/events/{id}/attachments/{ida}' + } _attachment_constructor = EventAttachment @@ -958,9 +961,13 @@ def to_api_data(self, restrict_keys=None): if self.__recurrence: data[cc('recurrence')] = self.__recurrence.to_api_data() - if self.has_attachments: - data[cc('attachments')] = self.__attachments.to_api_data() - +# if self.has_attachments: +# data[cc('attachments')] = self.__attachments.to_api_data() +# Event object doesn't have __attachments attribute... + + if 'attachments' in restrict_keys: + self.attachments._update_attachments_to_cloud() + if restrict_keys: for key in list(data.keys()): if key not in restrict_keys: From b5c733211dac647bc7734da769be02b739169a06 Mon Sep 17 00:00:00 2001 From: Ombental <30341654+Ombental@users.noreply.github.com> Date: Sat, 28 Nov 2020 19:18:01 +0200 Subject: [PATCH 2/3] Update calendar.py --- O365/calendar.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/O365/calendar.py b/O365/calendar.py index 2f5301c9..b277f6e9 100644 --- a/O365/calendar.py +++ b/O365/calendar.py @@ -960,10 +960,6 @@ def to_api_data(self, restrict_keys=None): if self.__recurrence: data[cc('recurrence')] = self.__recurrence.to_api_data() - -# if self.has_attachments: -# data[cc('attachments')] = self.__attachments.to_api_data() -# Event object doesn't have __attachments attribute... if 'attachments' in restrict_keys: self.attachments._update_attachments_to_cloud() From ff3e54e59ec12581883ae539e959e9b747434267 Mon Sep 17 00:00:00 2001 From: Ombental <30341654+Ombental@users.noreply.github.com> Date: Mon, 30 Nov 2020 20:24:53 +0200 Subject: [PATCH 3/3] Update calendar.py --- O365/calendar.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/O365/calendar.py b/O365/calendar.py index b277f6e9..e8f2cc30 100644 --- a/O365/calendar.py +++ b/O365/calendar.py @@ -961,6 +961,9 @@ def to_api_data(self, restrict_keys=None): if self.__recurrence: data[cc('recurrence')] = self.__recurrence.to_api_data() + if self.has_attachments: + data[cc('attachments')] = self.__attachments.to_api_data() + if 'attachments' in restrict_keys: self.attachments._update_attachments_to_cloud()