From 8d863e52b225262fd85791200d82f69675443645 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Thu, 11 Aug 2016 12:07:19 +0200 Subject: [PATCH] Re-enable properties storage on al collections Fix #475. --- radicale/xmlutils.py | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index d5cd3ec..f195aeb 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -644,26 +644,28 @@ def _propfind_response(path, item, props, user, write=False): element.append(tag) tag = ET.Element(_tag("D", "collection")) element.append(tag) - elif is_leaf: - if tag == _tag("D", "owner") and item.owner: + elif tag == _tag("D", "owner"): + if is_leaf and item.owner: element.text = "/%s/" % item.owner - elif tag == _tag("CS", "getctag"): - element.text = item.etag - elif tag == _tag("C", "calendar-timezone"): - element.text = item.get_meta("C:calendar-timezone") - elif tag == _tag("D", "displayname"): - element.text = item.get_meta("D:displayname") or item.path - elif tag == _tag("ICAL", "calendar-color"): - element.text = item.get_meta("ICAL:calendar-color") else: - human_tag = _tag_from_clark(tag) - meta = item.get_meta(human_tag) - if meta: - element.text = meta - else: - is404 = True + is404 = True + elif tag == _tag("D", "displayname"): + if is_leaf: + element.text = item.get_meta("D:displayname") or item.path + else: + is404 = True + elif tag == _tag("CS", "getctag"): + if is_leaf: + element.text = item.etag + else: + is404 = True else: - is404 = True + human_tag = _tag_from_clark(tag) + meta = item.get_meta(human_tag) + if meta: + element.text = meta + else: + is404 = True # Not for collections elif tag == _tag("D", "getcontenttype"): name = item.name.lower()