Parcourir la source

The item's rrule and time_range are in the vobject_item

Signed-off-by: David Greaves <david@dgreaves.com>
David Greaves il y a 8 mois
Parent
commit
3afdc73bc6
1 fichiers modifiés avec 8 ajouts et 2 suppressions
  1. 8 2
      radicale/app/report.py

+ 8 - 2
radicale/app/report.py

@@ -261,9 +261,15 @@ def xml_report(base_prefix: str, path: str, xml_request: Optional[ET.Element],
                                    (item.href, collection.path, e)) from e
 
         # Filtering non-recurring events by time-range
-        if (expand is not None) and (time_range_element is not None) and not hasattr(item, 'rrule'):
+        if hasattr(item.vobject_item, "vevent_list") and len(item.vobject_item.vevent_list) != 1:
+            # Not sure how to loop over these vevents
+            raise ValueError("vobject has too many events")
+        if ((expand is not None) and
+            (time_range_element is not None) and
+            not hasattr(item.vobject_item.vevent,
+                        'rrule')):
             start, end = radicale_filter.time_range_timestamps(time_range_element)
-            istart, iend = item.time_range
+            istart, iend = item.vobject_item.time_range
             if istart >= end or iend <= start:
                 continue