1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-04 18:22:26 +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() element.text = item.serialize()
if (expand is not None) and item.component_name == 'VEVENT': if (expand is not None) and item.component_name == 'VEVENT':
start = expand.get('start') starts = expand.get('start')
end = expand.get('end') ends = expand.get('end')
if (start is None) or (end is None): if (starts is None) or (ends is None):
return client.FORBIDDEN, \ return client.FORBIDDEN, \
xmlutils.webdav_error("C:expand") xmlutils.webdav_error("C:expand")
start = datetime.datetime.strptime( start = datetime.datetime.strptime(
start, '%Y%m%dT%H%M%SZ' starts, '%Y%m%dT%H%M%SZ'
).replace(tzinfo=datetime.timezone.utc) ).replace(tzinfo=datetime.timezone.utc)
end = datetime.datetime.strptime( end = datetime.datetime.strptime(
end, '%Y%m%dT%H%M%SZ' ends, '%Y%m%dT%H%M%SZ'
).replace(tzinfo=datetime.timezone.utc) ).replace(tzinfo=datetime.timezone.utc)
time_range_start = None time_range_start = None
@ -368,7 +368,7 @@ def _expand(
duration = None duration = None
# Generate EXDATE to remove from expansion range # Generate EXDATE to remove from expansion range
exdates_set = {} exdates_set: set[datetime.datetime] = set()
if hasattr(vevent_recurrence, 'exdate'): if hasattr(vevent_recurrence, 'exdate'):
exdates = vevent_recurrence.exdate.value exdates = vevent_recurrence.exdate.value
if not isinstance(exdates, list): if not isinstance(exdates, list):

View file

@ -22,12 +22,11 @@ Radicale tests with expand requests.
import os import os
from typing import ClassVar, List from typing import ClassVar, List
from xml.etree import ElementTree
from radicale.log import logger
from radicale.tests import BaseTest from radicale.tests import BaseTest
from radicale.tests.helpers import get_file_content from radicale.tests.helpers import get_file_content
from radicale.log import logger
from xml.etree import ElementTree
ONLY_DATES = True ONLY_DATES = True
CONTAINS_TIMES = False CONTAINS_TIMES = False