Fix detection of infinite recurrence
* The RRULE field might not exist. * vobject also accepts lower case COUNT and UNTIL.
This commit is contained in:
parent
82fc6f7eb6
commit
0e35ab1baf
@ -284,8 +284,9 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
|
|||||||
dtstart = child.dtstart.value
|
dtstart = child.dtstart.value
|
||||||
|
|
||||||
if child.rruleset:
|
if child.rruleset:
|
||||||
if (";UNTIL=" not in child.rrule.value and
|
if (hasattr(child, "rrule") and
|
||||||
";COUNT=" not in child.rrule.value):
|
";UNTIL=" not in child.rrule.value.upper() and
|
||||||
|
";COUNT=" not in child.rrule.value.upper()):
|
||||||
for dtstart in child.getrruleset(addRDate=True):
|
for dtstart in child.getrruleset(addRDate=True):
|
||||||
if infinity_fn(_date_to_datetime(dtstart)):
|
if infinity_fn(_date_to_datetime(dtstart)):
|
||||||
return
|
return
|
||||||
@ -357,8 +358,9 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
|
|||||||
created = _date_to_datetime(created.value)
|
created = _date_to_datetime(created.value)
|
||||||
|
|
||||||
if child.rruleset:
|
if child.rruleset:
|
||||||
if (";UNTIL=" not in child.rrule.value and
|
if (hasattr(child, "rrule") and
|
||||||
";COUNT=" not in child.rrule.value):
|
";UNTIL=" not in child.rrule.value.upper() and
|
||||||
|
";COUNT=" not in child.rrule.value.upper()):
|
||||||
for reference_date in child.getrruleset(addRDate=True):
|
for reference_date in child.getrruleset(addRDate=True):
|
||||||
if infinity_fn(_date_to_datetime(reference_date)):
|
if infinity_fn(_date_to_datetime(reference_date)):
|
||||||
return
|
return
|
||||||
@ -432,8 +434,9 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
|
|||||||
if dtstart is not None:
|
if dtstart is not None:
|
||||||
dtstart = dtstart.value
|
dtstart = dtstart.value
|
||||||
if child.rruleset:
|
if child.rruleset:
|
||||||
if (";UNTIL=" not in child.rrule.value and
|
if (hasattr(child, "rrule") and
|
||||||
";COUNT=" not in child.rrule.value):
|
";UNTIL=" not in child.rrule.value.upper() and
|
||||||
|
";COUNT=" not in child.rrule.value.upper()):
|
||||||
for dtstart in child.getrruleset(addRDate=True):
|
for dtstart in child.getrruleset(addRDate=True):
|
||||||
if infinity_fn(_date_to_datetime(dtstart)):
|
if infinity_fn(_date_to_datetime(dtstart)):
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user