diff --git a/custom-skills/32-notion-writer/code/scripts/notion_writer.py b/custom-skills/32-notion-writer/code/scripts/notion_writer.py index 4df2b78..0658f1d 100644 --- a/custom-skills/32-notion-writer/code/scripts/notion_writer.py +++ b/custom-skills/32-notion-writer/code/scripts/notion_writer.py @@ -349,8 +349,10 @@ def clear_page_content(notion: Client, page_id: str) -> bool: # Get all child blocks children = notion.blocks.children.list(block_id=formatted_id) - # Delete each block + # Delete each block (skip already archived blocks) for block in children.get('results', []): + if block.get('archived'): + continue notion.blocks.delete(block_id=block['id']) return True