I want to delete an Event of my Nextcloud calendar using CalDAV. But when I try to delete an object, I get an error.
This is my code:
import caldav
client = caldav.DAVClient(url='https://ppp.woelkli.com/remote.php/dav', username='[email protected]', password='Xxxxxxxx')
principal = client.Principal()
calendar = principal.calendars()[0]
event = calendar.events()[0]
caldav.Event(client=client, url=str(event), parent = calendar).delete()
I believe the correct code is
import caldav
client = caldav.DAVClient(url='https://ppp.woelkli.com/remote.php/dav', username='[email protected]', password='Xxxxxxxx')
principal = client.principal()
calendar = principal.calendars()[0]
event = calendar.events()[0]
event.delete()