Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyexchange/exchange2010/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,23 +383,23 @@ 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='<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'.


"""

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)
Expand Down