Fix sync if it contains cancelled events.

This commit is contained in:
redxef 2023-02-18 21:01:05 +01:00
parent a1ae079e8a
commit 5e0ff701da
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921

View file

@ -157,7 +157,11 @@ def main(config, dryrun, level, range):
if not any(source_results): if not any(source_results):
logger.error('event get failed for all sources') logger.error('event get failed for all sources')
return 1 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 # post events
if dryrun: if dryrun: