From b6e5519d7a8c17a0f20e8d7a21fb48dc03108d8d Mon Sep 17 00:00:00 2001 From: Achim Herwig Date: Sun, 18 Oct 2015 15:32:43 +0200 Subject: [PATCH] Enable getting of master item also for type 'Exception'. --- pyexchange/exchange2010/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyexchange/exchange2010/__init__.py b/pyexchange/exchange2010/__init__.py index d27d939..6996115 100644 --- a/pyexchange/exchange2010/__init__.py +++ b/pyexchange/exchange2010/__init__.py @@ -383,14 +383,14 @@ def move_to(self, folder_id): def get_master(self): """ get_master() - :raises InvalidEventType: When this method is called on an event that is not a Occurrence type. + :raises InvalidEventType: When this method is called on an event that is not a Occurrence or Exception type. This will return the master event to the occurrence. **Examples**:: event = service.calendar().get_event(id='') - print event.type # If it prints out 'Occurrence' then that means we could get the master. + print event.type # If it prints out 'Occurrence' (or 'Exception') then that means we could get the master. master = event.get_master() print master.type # Will print out 'RecurringMaster'. @@ -398,8 +398,8 @@ def get_master(self): """ - if self.type != 'Occurrence': - raise InvalidEventType("get_master method can only be called on a 'Occurrence' event type") + if self.type not in ('Occurrence','Exception'): + raise InvalidEventType("get_master method can only be called on a 'Occurrence' or 'Exception' event type") body = soap_request.get_master(exchange_id=self._id, format=u"AllProperties") response_xml = self.service.send(body)