From 5e0ff701da8431a9d4fdacf0ee4a92654fda0821 Mon Sep 17 00:00:00 2001 From: redxef Date: Sat, 18 Feb 2023 21:01:05 +0100 Subject: [PATCH] Fix sync if it contains cancelled events. --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 8ea01dd..12ab0fe 100755 --- a/main.py +++ b/main.py @@ -157,7 +157,11 @@ def main(config, dryrun, level, range): if not any(source_results): logger.error('event get failed for all sources') return 1 - logger.info("syncing %d events", len(events)) + # filter cancelled events + logger.info('found %d events', len(events)) + logger.info('not syncing cancelled events') + events = [e for e in events if e['status'] != 'cancelled'] + logger.info('syncing %d events', len(events)) # post events if dryrun: