1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-01 18:18:31 +00:00

Fix bug in free busy report serializing a datetime tzinfo

This commit is contained in:
Ray 2023-10-09 19:59:04 -06:00
parent 7b0d88ff0d
commit 4c1d295e81
2 changed files with 3 additions and 1 deletions

View file

@ -65,6 +65,7 @@ def free_busy_report(base_prefix: str, path: str, xml_request: Optional[ET.Eleme
vfb.add('dtstart').value, vfb.add('dtend').value = occurrence
return (client.OK, cal.serialize())
def xml_report(base_prefix: str, path: str, xml_request: Optional[ET.Element],
collection: storage.BaseCollection, encoding: str,
unlock_storage_fn: Callable[[], None]

View file

@ -48,7 +48,8 @@ def date_to_datetime(d: date) -> datetime:
if not isinstance(d, datetime):
d = datetime.combine(d, datetime.min.time())
if not d.tzinfo:
d = d.replace(tzinfo=timezone.utc)
# NOTE: using vobject's UTC as it wasn't playing well with datetime's.
d = d.replace(tzinfo=vobject.icalendar.utc)
return d