Fix owner property

This commit is contained in:
Unrud 2017-08-04 14:59:02 +02:00
parent c6ca643bcf
commit 8e88a47978

View File

@ -930,10 +930,11 @@ def _propfind_response(base_prefix, path, item, props, user, write=False,
tag = ET.Element(_tag("D", "collection")) tag = ET.Element(_tag("D", "collection"))
element.append(tag) element.append(tag)
elif tag == _tag("D", "owner"): elif tag == _tag("D", "owner"):
if is_leaf and item.owner: # return empty elment, if no owner available (rfc3744-5.1)
element.text = "/%s/" % item.owner if collection.owner:
else: tag = ET.Element(_tag("D", "href"))
is404 = True tag.text = _href(base_prefix, "/%s/" % collection.owner)
element.append(tag)
elif tag == _tag("D", "displayname"): elif tag == _tag("D", "displayname"):
if is_leaf: if is_leaf:
element.text = item.get_meta("D:displayname") or item.path element.text = item.get_meta("D:displayname") or item.path