Skip to content

Commit cbe17ca

Browse files
committed
fix: Pickling error
1 parent d556d8c commit cbe17ca

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

djangocms_rest/cms_config.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ def is_selected(self, request):
8080
)
8181

8282

83+
class NavigationNodeWithAPI(NavigationNodeMixin, base.NavigationNode):
84+
pass
85+
86+
8387
def add_api_endpoint(navigation_node: type[base.NavigationNode]):
8488
"""Add an API endpoint to the CMSNavigationNode."""
8589
if not issubclass(navigation_node, NavigationNodeMixin):
86-
navigation_node = type(
87-
f"{navigation_node.__name__}WithAPI",
88-
(navigation_node, NavigationNodeMixin),
89-
{},
90-
)
90+
navigation_node = NavigationNodeWithAPI
9191
return navigation_node
9292

9393

@@ -122,5 +122,6 @@ class RESTCMSConfig(CMSAppConfig):
122122

123123
Page.add_to_class("get_api_endpoint", get_page_api_endpoint)
124124
File.add_to_class("get_api_endpoint", get_file_api_endpoint) if File else None
125+
125126
base.NavigationNode = add_api_endpoint(base.NavigationNode)
126127
patch_page_menu(CMSMenu)

0 commit comments

Comments
 (0)