forked from ruangrupa/konfluks
cal: fix post deletion logic
This commit is contained in:
parent
58024c775a
commit
40bf9416b8
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user