Skip to content

Commit

Permalink
fix bug with sub-blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
imnotjames committed Mar 19, 2020
1 parent a9a8f6d commit aaf0aba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notion_docs_sync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,16 @@ def sync_markdown_blocks_to_block(markdown_blocks, block):
logger.info(f"Using existing markdown block {child_block.id} in {block.id}")
except StopIteration:
# If we've hit the end of the children create a new child.
logger.info(f"Creating new markdown block {child_block.id} in {block.id}")
child_block = block.children.add_new(markdown_block_class, **markdown_block)
logger.info(f"Creating new markdown block {child_block.id} in {block.id}")

touched_blocks.add(child_block.id)

if isinstance(child_block, CollectionViewBlock):
sync_collection_rows(child_block, collection_schema, collection_rows)

if block_children:
sync_markdown_blocks_to_block(markdown_blocks, child_block)
sync_markdown_blocks_to_block(block_children, child_block)

for c in block.children:
if c.type != 'page' and c.id not in touched_blocks:
Expand Down

0 comments on commit aaf0aba

Please sign in to comment.