From ea94ec919e4415b6d65b5ea9a5f5556e3c288637 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Thu, 28 Jun 2012 11:28:42 +0200 Subject: [PATCH] Use the right namespace for adressbook tags --- radicale/xmlutils.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 50fd56a..3399002 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -283,12 +283,14 @@ def _propfind_response(path, item, props, user): if item.is_principal: tag = ET.Element(_tag("D", "principal")) element.append(tag) - if item.is_leaf(item.path): - tag = ET.Element(_tag("C", item.resource_type)) - element.append(tag) - if not item.exists and item.resource_type: - # Collection not stored yet, but guessed resource type - tag = ET.Element(_tag("C", item.resource_type)) + if item.is_leaf(item.path) or ( + not item.exists and item.resource_type): + # 2nd case happens when the collection is not stored yet, + # but the resource type is guessed + if item.resource_type == "addressbook": + tag = ET.Element(_tag("CR", item.resource_type)) + else: + tag = ET.Element(_tag("C", item.resource_type)) element.append(tag) tag = ET.Element(_tag("D", "collection")) element.append(tag)