Merge pull request #481 from Unrud/patch-35

Revert 1ffc171
This commit is contained in:
Guillaume Ayoub 2016-08-13 04:22:13 +02:00 committed by GitHub
commit c9ac3114af

View File

@ -577,7 +577,11 @@ def _propfind_response(path, item, props, user, write=False):
tag = ET.Element(_tag("D", "href")) tag = ET.Element(_tag("D", "href"))
tag.text = _href(collection, "/") tag.text = _href(collection, "/")
element.append(tag) element.append(tag)
elif tag == _tag("D", "principal-URL") and collection.is_principal: elif (tag in (_tag("C", "calendar-user-address-set"),
_tag("D", "principal-URL"),
_tag("CR", "addressbook-home-set"),
_tag("C", "calendar-home-set")) and
collection.is_principal and is_collection):
tag = ET.Element(_tag("D", "href")) tag = ET.Element(_tag("D", "href"))
tag.text = _href(collection, path) tag.text = _href(collection, path)
element.append(tag) element.append(tag)
@ -595,11 +599,7 @@ def _propfind_response(path, item, props, user, write=False):
element.append(comp) element.append(comp)
else: else:
is404 = True is404 = True
elif tag in ( elif tag == _tag("D", "current-user-principal"):
_tag("D", "current-user-principal"),
_tag("C", "calendar-user-address-set"),
_tag("CR", "addressbook-home-set"),
_tag("C", "calendar-home-set")):
tag = ET.Element(_tag("D", "href")) tag = ET.Element(_tag("D", "href"))
tag.text = _href(collection, ("/%s/" % user) if user else "/") tag.text = _href(collection, ("/%s/" % user) if user else "/")
element.append(tag) element.append(tag)