From abb1de883b97465aa132b4a8168c41cdcc230174 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 5 Jan 2015 15:45:24 +0100 Subject: [PATCH] Allow PUT requests to change the whole calendar (see #250) --- radicale/xmlutils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index edba04f..17531fd 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -448,9 +448,12 @@ def put(path, ical_request, collection): if name in (item.name for item in collection.items): # PUT is modifying an existing item collection.replace(name, ical_request) - else: + elif name: # PUT is adding a new item collection.append(name, ical_request) + else: + # PUT is replacing the whole collection + collection.save(ical_request) def report(path, xml_request, collection):