Re-enable properties storage on al collections

Fix #475.
This commit is contained in:
Guillaume Ayoub 2016-08-11 12:07:19 +02:00
parent d3d29802ad
commit 8d863e52b2

View File

@ -644,17 +644,21 @@ def _propfind_response(path, item, props, user, write=False):
element.append(tag) element.append(tag)
tag = ET.Element(_tag("D", "collection")) tag = ET.Element(_tag("D", "collection"))
element.append(tag) element.append(tag)
elif is_leaf: elif tag == _tag("D", "owner"):
if tag == _tag("D", "owner") and item.owner: if is_leaf and item.owner:
element.text = "/%s/" % item.owner element.text = "/%s/" % item.owner
elif tag == _tag("CS", "getctag"): else:
element.text = item.etag is404 = True
elif tag == _tag("C", "calendar-timezone"):
element.text = item.get_meta("C:calendar-timezone")
elif tag == _tag("D", "displayname"): elif tag == _tag("D", "displayname"):
if is_leaf:
element.text = item.get_meta("D:displayname") or item.path element.text = item.get_meta("D:displayname") or item.path
elif tag == _tag("ICAL", "calendar-color"): else:
element.text = item.get_meta("ICAL:calendar-color") is404 = True
elif tag == _tag("CS", "getctag"):
if is_leaf:
element.text = item.etag
else:
is404 = True
else: else:
human_tag = _tag_from_clark(tag) human_tag = _tag_from_clark(tag)
meta = item.get_meta(human_tag) meta = item.get_meta(human_tag)
@ -662,8 +666,6 @@ def _propfind_response(path, item, props, user, write=False):
element.text = meta element.text = meta
else: else:
is404 = True is404 = True
else:
is404 = True
# Not for collections # Not for collections
elif tag == _tag("D", "getcontenttype"): elif tag == _tag("D", "getcontenttype"):
name = item.name.lower() name = item.name.lower()