Skip to content

Commit ee90acc

Browse files
committed
Add TinyTableBlock kwargs to signature
Having types in here makes this line *really* long, so I went ahead and restructured this as a multiline signature.
1 parent 89d96bf commit ee90acc

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/wagtail_tinytableblock/blocks.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,23 @@ class TinyTableBlock(StructBlock):
9090
title = CharBlock(required=False)
9191
caption = CharBlock(required=False)
9292

93-
def __init__(self, local_blocks: BlockDefinitions | None = None, search_index: bool = True, **kwargs) -> None: # noqa: FBT001,FBT002
93+
def __init__(
94+
self,
95+
local_blocks: BlockDefinitions | None = None,
96+
search_index: bool = True, # noqa: FBT001,FBT002
97+
*,
98+
allow_links: bool = False,
99+
enable_context_menu: bool = False,
100+
**kwargs
101+
) -> None:
94102
if local_blocks is None:
95103
local_blocks = ()
96104

97105
# Manually define the data block so we can pass on configuration kwargs.
98106
data_block = TinyTableFieldBlock(
99107
required=False,
100-
allow_links=kwargs.get("allow_links", False),
101-
enable_context_menu=kwargs.get("enable_context_menu", False),
108+
allow_links=allow_links,
109+
enable_context_menu=enable_context_menu,
102110
)
103111

104112
local_blocks = (*local_blocks, ("data", data_block))

0 commit comments

Comments
 (0)