1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-26 16:45:52 +00:00

DELETE requests can delete calendars (closes #514)

This commit is contained in:
Guillaume Ayoub 2011-11-29 17:41:08 +01:00
parent bfe527dd41
commit 1f2f39a87a
3 changed files with 25 additions and 8 deletions

View file

@ -153,7 +153,12 @@ def delete(path, calendar):
"""
# Reading request
calendar.remove(name_from_path(path, calendar))
if calendar.local_path == path.strip("/"):
# Delete the whole calendar
calendar.delete()
else:
# Remove an item from the calendar
calendar.remove(name_from_path(path, calendar))
# Writing answer
multistatus = ET.Element(_tag("D", "multistatus"))