diff --git a/O365/calendar.py b/O365/calendar.py index 2248ae58b181..041aeef51ba5 100644 --- a/O365/calendar.py +++ b/O365/calendar.py @@ -857,8 +857,7 @@ def __init__(self, *, parent=None, con=None, **kwargs): self.__is_all_day = cloud_data.get(cc('isAllDay'), False) self.is_cancelled = cloud_data.get(cc('isCancelled'), False) self.is_organizer = cloud_data.get(cc('isOrganizer'), True) - self.__location = cloud_data.get(cc('location'), {}).get( - cc('displayName'), '') + self.__location = cloud_data.get(cc('location'), {}) self.locations = cloud_data.get(cc('locations'), []) # TODO self.online_meeting_url = cloud_data.get(cc('onlineMeetingUrl'), None) self.__organizer = self._recipient_from_cloud( @@ -897,6 +896,14 @@ def to_api_data(self, restrict_keys=None): :rtype: dict """ cc = self._cc # alias + if self.__location: + if isinstance(self.__location, dict): + location = self.__location + else: + location = {cc('displayName'): self.__location} + else: + location = {cc('displayName'): ''} + data = { cc('subject'): self.__subject, cc('body'): { @@ -905,7 +912,7 @@ def to_api_data(self, restrict_keys=None): cc('start'): self._build_date_time_time_zone(self.__start), cc('end'): self._build_date_time_time_zone(self.__end), cc('attendees'): self.__attendees.to_api_data(), - cc('location'): {cc('displayName'): self.__location}, + cc('location'): location, cc('categories'): self.__categories, cc('isAllDay'): self.__is_all_day, cc('importance'): cc(self.__importance.value), diff --git a/setup.py b/setup.py index 0bd72c2bc612..d2a01c6e0982 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages -VERSION = '1.1.9' +VERSION = '1.1.10' # Available classifiers: https://pypi.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [