🐛 fix: declined events not cancelled
Events were declined but not cancelled what lead to a loop of allready declined events getting declined again in every run.
This commit is contained in:
parent
f053f4456f
commit
14dd63ad72
|
|
@ -76,6 +76,7 @@ def clear(target_calendars: list, is_test: bool=False) -> dict:
|
|||
end=date.today() + timedelta(days=horizon),
|
||||
event=True,
|
||||
expand=True,
|
||||
split_expanded=True,
|
||||
)
|
||||
|
||||
events = []
|
||||
|
|
@ -85,7 +86,7 @@ def clear(target_calendars: list, is_test: bool=False) -> dict:
|
|||
# Delete cancelled non-recurring events if not in test mode
|
||||
if (component.name == "VEVENT"
|
||||
and is_cancelled_event(event)
|
||||
and not event.is_recurring):
|
||||
and not is_recurring_event(event)):
|
||||
|
||||
if not is_test:
|
||||
event.delete()
|
||||
|
|
@ -189,6 +190,8 @@ def clear(target_calendars: list, is_test: bool=False) -> dict:
|
|||
elif not event.is_cancelled:
|
||||
if not is_test:
|
||||
event.obj.decline_invite()
|
||||
event.obj.icalendar_component["status"] = "CANCELLED"
|
||||
event.obj.save()
|
||||
is_cancelled = True
|
||||
result["cancellation_type"] = "cancelled"
|
||||
results["cancelled_overlapping_recurring_events"].append(result)
|
||||
|
|
|
|||
Loading…
Reference in New Issue