Restore the Lightning + anonymous calendars support
This commit is contained in:
parent
ec9e410659
commit
b8bcf65785
@ -194,7 +194,7 @@ class Calendar(object):
|
|||||||
path = "/".join(attributes[:min(len(attributes), 2)])
|
path = "/".join(attributes[:min(len(attributes), 2)])
|
||||||
path = path.replace("/", os.sep)
|
path = path.replace("/", os.sep)
|
||||||
abs_path = os.path.join(FOLDER, path)
|
abs_path = os.path.join(FOLDER, path)
|
||||||
if os.path.isdir(abs_path) or len(attributes) == 1:
|
if os.path.isdir(abs_path):
|
||||||
if depth == "0":
|
if depth == "0":
|
||||||
result.append(cls(path, principal=True))
|
result.append(cls(path, principal=True))
|
||||||
else:
|
else:
|
||||||
@ -297,8 +297,6 @@ class Calendar(object):
|
|||||||
|
|
||||||
def write(self, headers=None, items=None):
|
def write(self, headers=None, items=None):
|
||||||
"""Write calendar with given parameters."""
|
"""Write calendar with given parameters."""
|
||||||
if self.is_principal:
|
|
||||||
return
|
|
||||||
headers = headers or self.headers or (
|
headers = headers or self.headers or (
|
||||||
Header("PRODID:-//Radicale//NONSGML Radicale Server//EN"),
|
Header("PRODID:-//Radicale//NONSGML Radicale Server//EN"),
|
||||||
Header("VERSION:2.0"))
|
Header("VERSION:2.0"))
|
||||||
|
@ -264,7 +264,9 @@ def _propfind_response(path, item, props, user):
|
|||||||
if tag == _tag("D", "getcontenttype"):
|
if tag == _tag("D", "getcontenttype"):
|
||||||
element.text = "text/calendar"
|
element.text = "text/calendar"
|
||||||
elif tag == _tag("D", "resourcetype"):
|
elif tag == _tag("D", "resourcetype"):
|
||||||
if not item.is_principal:
|
if item.is_principal:
|
||||||
|
tag = ET.Element(_tag("D", "principal"))
|
||||||
|
element.append(tag)
|
||||||
tag = ET.Element(_tag("C", "calendar"))
|
tag = ET.Element(_tag("C", "calendar"))
|
||||||
element.append(tag)
|
element.append(tag)
|
||||||
tag = ET.Element(_tag("D", "collection"))
|
tag = ET.Element(_tag("D", "collection"))
|
||||||
@ -284,6 +286,9 @@ def _propfind_response(path, item, props, user):
|
|||||||
# Not for calendars
|
# Not for calendars
|
||||||
elif tag == _tag("D", "getcontenttype"):
|
elif tag == _tag("D", "getcontenttype"):
|
||||||
element.text = "text/calendar; component=%s" % item.tag.lower()
|
element.text = "text/calendar; component=%s" % item.tag.lower()
|
||||||
|
elif tag == _tag("D", "resourcetype"):
|
||||||
|
# resourcetype must be returned empty for non-collection elements
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
is404 = True
|
is404 = True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user