sharing/propfind: fix Properties overlay

This commit is contained in:
Peter Bieringer
2026-03-14 16:57:49 +01:00
parent 76fb3d5ebf
commit c1b46a8b7a

View File

@@ -315,7 +315,7 @@ def xml_propfind_response(
elif tag == xmlutils.make_clark("RADICALE:displayname"): elif tag == xmlutils.make_clark("RADICALE:displayname"):
# Only for internal use by the web interface # Only for internal use by the web interface
displayname = collection.get_meta("D:displayname") displayname = collection.get_meta("D:displayname")
if share and share['Properties'] and share['Properties']["D:displayname"]: if share and 'Properties' in share and share['Properties'] is not None and "D:displayname" in share['Properties']:
displayname = share['Properties']["D:displayname"] displayname = share['Properties']["D:displayname"]
if displayname is not None: if displayname is not None:
element.text = displayname element.text = displayname
@@ -329,7 +329,7 @@ def xml_propfind_response(
is404 = True is404 = True
elif tag == xmlutils.make_clark("D:displayname"): elif tag == xmlutils.make_clark("D:displayname"):
displayname = collection.get_meta("D:displayname") displayname = collection.get_meta("D:displayname")
if share and share['Properties'] and share['Properties']["D:displayname"]: if share and 'Properties' in share and share['Properties'] is not None and "D:displayname" in share['Properties']:
displayname = share['Properties']["D:displayname"] displayname = share['Properties']["D:displayname"]
if not displayname and is_leaf: if not displayname and is_leaf:
displayname = collection.path displayname = collection.path
@@ -357,12 +357,10 @@ def xml_propfind_response(
else: else:
human_tag = xmlutils.make_human_tag(tag) human_tag = xmlutils.make_human_tag(tag)
tag_text = collection.get_meta(human_tag) tag_text = collection.get_meta(human_tag)
if share: if share and 'Properties' in share and share['Properties'] is not None and human_tag in share['Properties']:
# map/add from overlay # map/add from overlay
if share['Properties']: if share['Properties'][human_tag] is not None:
if human_tag in share['Properties']: tag_text = share['Properties'][human_tag]
if share['Properties'][human_tag] is not None:
tag_text = share['Properties'][human_tag]
if tag_text is not None: if tag_text is not None:
element.text = tag_text element.text = tag_text
else: else: