diff --git a/shopdb/core/api/dashboard.py b/shopdb/core/api/dashboard.py index 52c48a4..7ed5610 100644 --- a/shopdb/core/api/dashboard.py +++ b/shopdb/core/api/dashboard.py @@ -120,9 +120,14 @@ def get_navigation(): {'name': 'Map', 'icon': 'map', 'route': '/map', 'position': 4}, ]) - # Collect navigation items from all plugins + # Collect navigation items from enabled plugins. Disabling persists to the + # registry immediately, so a disabled plugin drops out of the menu right + # away (its routes stay registered until the next restart - Flask cannot + # unregister a blueprint at runtime). for name, plugin in pm.get_all_plugins().items(): try: + if not pm.registry.is_enabled(name): + continue items = plugin.get_navigation_items() for item in items: item['plugin'] = name