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

fix typing and lint issues from tox

Signed-off-by: David Greaves <david@dgreaves.com>
This commit is contained in:
David Greaves 2025-07-06 16:51:57 +01:00
parent 2a304259fe
commit ce0aaffa86
2 changed files with 8 additions and 9 deletions

View file

@ -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):

View file

@ -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