Allow PUT requests to change the whole calendar (see #250)

This commit is contained in:
Guillaume Ayoub 2015-01-05 15:45:24 +01:00
parent 6e715912f6
commit abb1de883b

View File

@ -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):