diff --git a/radicale/app/report.py b/radicale/app/report.py index ad176d63..c24e17f4 100644 --- a/radicale/app/report.py +++ b/radicale/app/report.py @@ -277,18 +277,18 @@ def xml_report(base_prefix: str, path: str, xml_request: Optional[ET.Element], element.text = item.serialize() if (expand is not None) and item.component_name == 'VEVENT': - start = expand.get('start') - end = expand.get('end') + starts = expand.get('start') + ends = expand.get('end') - if (start is None) or (end is None): + if (starts is None) or (ends is None): return client.FORBIDDEN, \ xmlutils.webdav_error("C:expand") start = datetime.datetime.strptime( - start, '%Y%m%dT%H%M%SZ' + starts, '%Y%m%dT%H%M%SZ' ).replace(tzinfo=datetime.timezone.utc) end = datetime.datetime.strptime( - end, '%Y%m%dT%H%M%SZ' + ends, '%Y%m%dT%H%M%SZ' ).replace(tzinfo=datetime.timezone.utc) time_range_start = None @@ -368,7 +368,7 @@ def _expand( duration = None # Generate EXDATE to remove from expansion range - exdates_set = {} + exdates_set: set[datetime.datetime] = set() if hasattr(vevent_recurrence, 'exdate'): exdates = vevent_recurrence.exdate.value if not isinstance(exdates, list): diff --git a/radicale/tests/test_expand.py b/radicale/tests/test_expand.py index c9cee5f9..2b7dee1d 100644 --- a/radicale/tests/test_expand.py +++ b/radicale/tests/test_expand.py @@ -22,12 +22,11 @@ Radicale tests with expand requests. import os from typing import ClassVar, List +from xml.etree import ElementTree +from radicale.log import logger from radicale.tests import BaseTest from radicale.tests.helpers import get_file_content -from radicale.log import logger - -from xml.etree import ElementTree ONLY_DATES = True CONTAINS_TIMES = False