Use the right namespace for adressbook tags

This commit is contained in:
Guillaume Ayoub 2012-06-28 11:28:42 +02:00
parent cff6c2b43b
commit ea94ec919e

View File

@ -283,12 +283,14 @@ def _propfind_response(path, item, props, user):
if item.is_principal: if item.is_principal:
tag = ET.Element(_tag("D", "principal")) tag = ET.Element(_tag("D", "principal"))
element.append(tag) element.append(tag)
if item.is_leaf(item.path): if item.is_leaf(item.path) or (
tag = ET.Element(_tag("C", item.resource_type)) not item.exists and item.resource_type):
element.append(tag) # 2nd case happens when the collection is not stored yet,
if not item.exists and item.resource_type: # but the resource type is guessed
# Collection not stored yet, but guessed resource type if item.resource_type == "addressbook":
tag = ET.Element(_tag("C", item.resource_type)) tag = ET.Element(_tag("CR", item.resource_type))
else:
tag = ET.Element(_tag("C", item.resource_type))
element.append(tag) element.append(tag)
tag = ET.Element(_tag("D", "collection")) tag = ET.Element(_tag("D", "collection"))
element.append(tag) element.append(tag)