mirror of
https://github.com/Kozea/Radicale.git
synced 2025-04-06 06:37:36 +03:00
Stop being stupid for report requests
This commit is contained in:
parent
0cdc5b06da
commit
fe0f3020a4
1 changed files with 6 additions and 2 deletions
|
@ -412,13 +412,17 @@ def report(path, xml_request, calendar):
|
||||||
# Writing answer
|
# Writing answer
|
||||||
multistatus = ET.Element(_tag("D", "multistatus"))
|
multistatus = ET.Element(_tag("D", "multistatus"))
|
||||||
|
|
||||||
|
calendar_items = calendar.items
|
||||||
|
calendar_headers = calendar.headers
|
||||||
|
calendar_timezones = calendar.timezones
|
||||||
|
|
||||||
for hreference in hreferences:
|
for hreference in hreferences:
|
||||||
# Check if the reference is an item or a calendar
|
# Check if the reference is an item or a calendar
|
||||||
name = name_from_path(hreference, calendar)
|
name = name_from_path(hreference, calendar)
|
||||||
if name:
|
if name:
|
||||||
# Reference is an item
|
# Reference is an item
|
||||||
path = "/".join(hreference.split("/")[:-1]) + "/"
|
path = "/".join(hreference.split("/")[:-1]) + "/"
|
||||||
items = (item for item in calendar.items if item.name == name)
|
items = (item for item in calendar_items if item.name == name)
|
||||||
else:
|
else:
|
||||||
# Reference is a calendar
|
# Reference is a calendar
|
||||||
path = hreference
|
path = hreference
|
||||||
|
@ -445,7 +449,7 @@ def report(path, xml_request, calendar):
|
||||||
elif tag == _tag("C", "calendar-data"):
|
elif tag == _tag("C", "calendar-data"):
|
||||||
if isinstance(item, (ical.Event, ical.Todo, ical.Journal)):
|
if isinstance(item, (ical.Event, ical.Todo, ical.Journal)):
|
||||||
element.text = ical.serialize(
|
element.text = ical.serialize(
|
||||||
calendar.headers, calendar.timezones + [item])
|
calendar_headers, calendar_timezones + [item])
|
||||||
prop.append(element)
|
prop.append(element)
|
||||||
|
|
||||||
status = ET.Element(_tag("D", "status"))
|
status = ET.Element(_tag("D", "status"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue