From 387e1fee767b26729b81d8016009320196e7f3b6 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Sun, 5 Jan 2014 22:15:51 +0100 Subject: [PATCH] Fix calendar/addressbook-home-set in PROPFIND response --- radicale/xmlutils.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 3b29036..1d2f2bf 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -288,9 +288,15 @@ def _propfind_response(path, item, props, user): tag = ET.Element(_tag("D", "href")) tag.text = _href("/") element.append(tag) - elif tag in (_tag("C", "calendar-user-address-set"), - _tag("CR", "addressbook-home-set"), - _tag("C", "calendar-home-set")): + elif tag in (_tag("C", "calendar-home-set"), + _tag("CR", "addressbook-home-set")): + if user and path == "/%s/" % user: + tag = ET.Element(_tag("D", "href")) + tag.text = _href(path) + element.append(tag) + else: + is404 = True + elif tag == _tag("C", "calendar-user-address-set"): tag = ET.Element(_tag("D", "href")) tag.text = _href(path) element.append(tag)