Beispiel #1
0
    def delete_single_event(klass, event):
        """"""
        try:
            response = gcal_client.delete_event(event)
        except GoogleCalendarAPIError as e:
            event.delete()
            raise e

        event.delete()

        # Return the Google Calendar response
        return response
Beispiel #2
0
    def delete_single_event(klass, event):
        """"""
        try:
            response = gcal_client.delete_event(event)
        except GoogleCalendarAPIError as e:
            event.delete()
            raise e

        event.delete()

        # Return the Google Calendar response
        return response
Beispiel #3
0
    def delete_series(klass, event):
        """"""
        # Delete the series
        try:
            response = gcal_client.delete_event(event)
        except GoogleCalendarAPIError as e:
            event.parent_series.delete_all()
            raise e

        event.parent_series.delete_all()

        # Return the Google Calendar response
        return response
Beispiel #4
0
    def delete_series(klass, event):
        """"""
        # Delete the series
        try:
            response = gcal_client.delete_event(event)
        except GoogleCalendarAPIError as e:
            event.parent_series.delete_all()
            raise e

        event.parent_series.delete_all()

        # Return the Google Calendar response
        return response
Beispiel #5
0
    def delete_single_event_from_series(klass, event):
        """"""
        # Cancel the series on Google Calendar
        try:
            response = gcal_client.delete_event(event, as_exception=True)
        except GoogleCalendarAPIError as e:
            event.parent_series.delete_one(event)
            raise e

        # Delete the one event
        event.parent_series.delete_one(event)

        # Return the Google Calendar response
        return response
Beispiel #6
0
    def delete_single_event_from_series(klass, event):
        """"""
        # Cancel the series on Google Calendar
        try:
            response = gcal_client.delete_event(event, as_exception=True)
        except GoogleCalendarAPIError as e:
            event.parent_series.delete_one(event)
            raise e

        # Delete the one event
        event.parent_series.delete_one(event)

        # Return the Google Calendar response
        return response
Beispiel #7
0
    def delete_series(cls, event):
        """Deletes the recurring `event`, syncing changes to Google Calendar.

        :param event: The event to delete.
        :type event: :class:`Event`

        :raises: :class:`GoogleCalendarAPIError` and it's subclasses

        :returns: Response from the Google Calendar API.
        :rtype: dict
        """

        # We have to delete on Google Calendar first, but we should delete the
        # event from MongoEngine even if Google Calendar throws an error.
        try:
            response = gcal_client.delete_event(event)
        finally:
            event.parent_series.delete_all()

        # Return the Google Calendar response
        return response
Beispiel #8
0
    def delete_series(klass, event):
        """Deletes the recurring `event`, syncing changes to Google Calendar.

        :param event: The event to delete.
        :type event: :class:`Event`

        :raises: :class:`GoogleCalendarAPIError` and it's subclasses

        :returns: Response from the Google Calendar API.
        :rtype: dict
        """

        # We have to delete on Google Calendar first, but we should delete the
        # event from MongoEngine even if Google Calendar throws an error.
        try:
            response = gcal_client.delete_event(event)
        finally:
            event.parent_series.delete_all()

        # Return the Google Calendar response
        return response
Beispiel #9
0
    def delete_single_event_from_series(cls, event):
        """Deletes ``event`` from it's parent series, syncing changes to Google
        Calendar.

        :param event: The event to delete.
        :type event: :class:`Event`

        :raises: :class:`GoogleCalendarAPIError` and it's subclasses

        :returns: Response from the Google Calendar API.
        :rtype: dict
        """

        # We have to delete on Google Calendar first, but we should delete the
        # event from MongoEngine even if Google Calendar throws an error.
        try:
            # Cancel the series on Google Calendar
            response = gcal_client.delete_event(event, as_exception=True)
        finally:
            event.parent_series.delete_one(event)

        # Return the Google Calendar response
        return response
Beispiel #10
0
    def delete_single_event_from_series(klass, event):
        """Deletes ``event`` from it's parent series, syncing changes to Google
        Calendar.

        :param event: The event to delete.
        :type event: :class:`Event`

        :raises: :class:`GoogleCalendarAPIError` and it's subclasses

        :returns: Response from the Google Calendar API.
        :rtype: dict
        """

        # We have to delete on Google Calendar first, but we should delete the
        # event from MongoEngine even if Google Calendar throws an error.
        try:
            # Cancel the series on Google Calendar
            response = gcal_client.delete_event(event, as_exception=True)
        finally:
            event.parent_series.delete_one(event)

        # Return the Google Calendar response
        return response