File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -80,14 +80,14 @@ def is_selected(self, request):
8080 )
8181
8282
83+ class NavigationNodeWithAPI (NavigationNodeMixin , base .NavigationNode ):
84+ pass
85+
86+
8387def 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 )
You can’t perform that action at this time.
0 commit comments