From c3ce8fde389075aa3c83b3db58b28f127c27ccf1 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Wed, 11 Apr 2012 19:47:08 +0200 Subject: [PATCH] In PROPFIND responses, add the not-yet-created collection type when it can be guessed Maybe related to #795 --- radicale/xmlutils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 475e169..d5277a6 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -286,6 +286,10 @@ def _propfind_response(path, item, props, user): 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)) + element.append(tag) tag = ET.Element(_tag("D", "collection")) element.append(tag) elif tag == _tag("D", "owner") and item.owner_url: