Add DAV:owner property to items

This commit is contained in:
Unrud 2017-09-17 14:03:59 +02:00
parent 152f9ea444
commit 99133a3476

View File

@ -968,6 +968,12 @@ def _propfind_response(base_prefix, path, item, props, user, write=False,
element.text = str(len(item.serialize().encode(encoding))) element.text = str(len(item.serialize().encode(encoding)))
else: else:
is404 = True is404 = True
elif tag == _tag("D", "owner"):
# return empty elment, if no owner available (rfc3744-5.1)
if collection.owner:
tag = ET.Element(_tag("D", "href"))
tag.text = _href(base_prefix, "/%s/" % collection.owner)
element.append(tag)
elif is_collection: elif is_collection:
if tag == _tag("D", "getcontenttype"): if tag == _tag("D", "getcontenttype"):
if is_leaf: if is_leaf:
@ -987,12 +993,6 @@ def _propfind_response(base_prefix, 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 tag == _tag("D", "owner"):
# return empty elment, if no owner available (rfc3744-5.1)
if collection.owner:
tag = ET.Element(_tag("D", "href"))
tag.text = _href(base_prefix, "/%s/" % collection.owner)
element.append(tag)
elif tag == _tag("RADICALE", "displayname"): elif tag == _tag("RADICALE", "displayname"):
# Only for internal use by the web interface # Only for internal use by the web interface
displayname = item.get_meta("D:displayname") displayname = item.get_meta("D:displayname")