mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Minor cleanups
Everything works fine with Apple clients now.
This commit is contained in:
parent
b517818749
commit
6b30870be5
3 changed files with 11 additions and 20 deletions
|
@ -505,8 +505,7 @@ def delete(path, collection):
|
|||
return _pretty_xml(multistatus)
|
||||
|
||||
|
||||
def propfind(path, xml_request, read_collections, write_collections,
|
||||
user=None):
|
||||
def propfind(path, xml_request, read_collections, write_collections, user):
|
||||
"""Read and answer PROPFIND requests.
|
||||
|
||||
Read rfc4918-9.1 for info.
|
||||
|
@ -552,7 +551,7 @@ def _propfind_response(path, item, props, user, write=False):
|
|||
# TODO: fix this
|
||||
is_collection = hasattr(item, "list")
|
||||
if is_collection:
|
||||
is_leaf = bool(item.list())
|
||||
is_leaf = bool(item.get_meta("tag"))
|
||||
collection = item
|
||||
else:
|
||||
collection = item.collection
|
||||
|
@ -671,16 +670,7 @@ def _propfind_response(path, item, props, user, write=False):
|
|||
elif tag == _tag("CS", "getctag"):
|
||||
element.text = item.etag
|
||||
elif tag == _tag("C", "calendar-timezone"):
|
||||
timezones = set()
|
||||
for href, _ in item.list():
|
||||
event = item.get(href)
|
||||
if "vtimezone" in event.contents:
|
||||
for timezone_ in event.vtimezone_list:
|
||||
timezones.add(timezone_)
|
||||
timezone_collection = vobject.iCalendar()
|
||||
for timezone_ in timezones:
|
||||
timezone_collection.add(timezone_)
|
||||
element.text = timezone_collection.serialize()
|
||||
element.text = item.get_meta("C:calendar-timezone")
|
||||
elif tag == _tag("D", "displayname"):
|
||||
element.text = item.get_meta("D:displayname") or item.path
|
||||
elif tag == _tag("ICAL", "calendar-color"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue