From ec3366496e0a91d657f8a7b21d0826e5bc7d280e Mon Sep 17 00:00:00 2001 From: David Greaves Date: Thu, 3 Jul 2025 19:33:19 +0100 Subject: [PATCH] fixes tests where range starts inside an event test_report_with_expand_property_start_inside test_report_with_expand_property_just_inside Signed-off-by: David Greaves --- radicale/app/report.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/radicale/app/report.py b/radicale/app/report.py index 2601b453..89313c53 100644 --- a/radicale/app/report.py +++ b/radicale/app/report.py @@ -357,6 +357,8 @@ def _expand( duration = None if hasattr(vevent_recurrence, "dtend"): duration = vevent_recurrence.dtend.value - vevent_recurrence.dtstart.value + elif hasattr(vevent_recurrence, "duration"): + duration = vevent_recurrence.duration.value # Handle EXDATE to limit expansion range if hasattr(vevent_recurrence, 'exdate'): @@ -428,7 +430,8 @@ def _expand( name='DTSTART', value=recurrence_id.strftime(dt_format), params={} ) - if duration: + # if there is a DTEND, override it. Duration does not need changing + if hasattr(vevent, "dtend"): vevent.dtend = ContentLine( name='DTEND', value=(recurrence_id + duration).strftime(dt_format), params={}