Atomic PROPPATCH

This commit is contained in:
Unrud 2016-08-03 14:45:52 +02:00
parent de510148a0
commit bd7641699e
3 changed files with 21 additions and 24 deletions

View file

@ -757,12 +757,14 @@ def proppatch(path, xml_request, collection):
href.text = _href(collection, path)
response.append(href)
for short_name, value in props_to_set.items():
collection.set_meta(short_name, value)
_add_propstat_to(response, short_name, 200)
# Merge props_to_set and props_to_remove
for short_name in props_to_remove:
collection.set_meta(short_name, "")
props_to_set[short_name] = ""
# Set/Delete props in one atomic operation
collection.set_meta(props_to_set)
for short_name in props_to_set:
_add_propstat_to(response, short_name, 200)
return _pretty_xml(multistatus)