Allow PUT requests to change the whole calendar (see #250)
This commit is contained in:
parent
6e715912f6
commit
abb1de883b
@ -448,9 +448,12 @@ def put(path, ical_request, collection):
|
|||||||
if name in (item.name for item in collection.items):
|
if name in (item.name for item in collection.items):
|
||||||
# PUT is modifying an existing item
|
# PUT is modifying an existing item
|
||||||
collection.replace(name, ical_request)
|
collection.replace(name, ical_request)
|
||||||
else:
|
elif name:
|
||||||
# PUT is adding a new item
|
# PUT is adding a new item
|
||||||
collection.append(name, ical_request)
|
collection.append(name, ical_request)
|
||||||
|
else:
|
||||||
|
# PUT is replacing the whole collection
|
||||||
|
collection.save(ical_request)
|
||||||
|
|
||||||
|
|
||||||
def report(path, xml_request, collection):
|
def report(path, xml_request, collection):
|
||||||
|
Loading…
Reference in New Issue
Block a user