From 40bf9416b8792c08683ad8ac878093c7ef1b2f5d Mon Sep 17 00:00:00 2001 From: knoflook Date: Mon, 7 Feb 2022 11:50:41 +0100 Subject: [PATCH] cal: fix post deletion logic --- lumbunglib/cloudcal.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lumbunglib/cloudcal.py b/lumbunglib/cloudcal.py index 2375f31..7f67017 100644 --- a/lumbunglib/cloudcal.py +++ b/lumbunglib/cloudcal.py @@ -193,18 +193,18 @@ def update_event_post(post_dir, event): def main(): for event in list(cal.events): + post_name = sanitize_name(event.name) + "-" + event.uid + post_dir = os.path.join(output_dir, post_name) - post_dir = os.path.join(output_dir, sanitize_name(event.name) + "-" + event.uid) - - if event.uid not in existing_posts: + if post_name not in existing_posts: # if there is an event we dont already have, make it create_event_post(post_dir, event) - elif event.uid in existing_posts: + elif post_name in existing_posts: # if we already have it, update update_event_post(post_dir, event) existing_posts.remove( - event.uid + post_name ) # create list of posts which have not been returned by the calendar for post in existing_posts: