Skip to content

Commit 6324280

Browse files
committed
fix: some blocks don't have a title like the DividerBlock
This makes it so they are handled correctly when displayed via the API.
1 parent 9b84b3e commit 6324280

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

shared/notionscripts/block_presenter.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env -S PATH="${PATH}:/usr/local/bin" python3
22

33
from notion.collection import CollectionRowBlock, CollectionView
4+
from notion.block import DividerBlock
45

56

67
class BlockPresenter(dict):
@@ -12,5 +13,7 @@ def __init__(self, block):
1213
elif isinstance(block, CollectionView):
1314
dict.__init__(self, **{"collection_id": block.parent.id.replace("-", ""), "view_id": block.id.replace("-", ""),
1415
"collection_title": block.parent.title, "view_title": block.name})
16+
elif isinstance(block, DividerBlock):
17+
dict.__init__(self, **{"id": block.id.replace("-", "")})
1518
else:
1619
dict.__init__(self, **{"id": block.id.replace("-", ""), "title": block.title})

0 commit comments

Comments
 (0)