Only show CMS toolbar item when in app

This commit is contained in:
Stefan Wehrmeyer 2024-04-25 10:57:33 +02:00
parent 0722779a2f
commit 5cd2562cc7

View file

@ -9,10 +9,7 @@ from . import conf
class GovPlanToolbar(CMSToolbar): class GovPlanToolbar(CMSToolbar):
def populate(self): def populate(self):
if ( if not self.is_current_app:
self.request.current_page
and self.request.current_page.application_namespace != "govplan"
):
return return
menu = self.toolbar.get_or_create_menu("govplan-menu", conf.GOVPLAN_NAME) menu = self.toolbar.get_or_create_menu("govplan-menu", conf.GOVPLAN_NAME)