2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 20:15:44 +00:00

Disable panel return if plugin integration is not enabled

This commit is contained in:
Oliver Walters
2024-08-11 06:25:48 +00:00
parent d73590f02f
commit e8ae6410ce

View File

@ -17,6 +17,7 @@ from rest_framework.views import APIView
import plugin.serializers as PluginSerializers
from common.api import GlobalSettingsPermissions
from common.settings import get_global_setting
from InvenTree.api import MetadataView
from InvenTree.filters import SEARCH_ORDER_FILTER
from InvenTree.mixins import (
@ -429,10 +430,13 @@ class PluginPanelList(APIView):
panels = []
if get_global_setting('ENABLE_PLUGINS_INTERFACE'):
# Extract all plugins from the registry which provide custom panels
for _plugin in registry.with_mixin('ui', active=True):
# Allow plugins to fill this data out
plugin_panels = _plugin.get_custom_panels(target_model, target_id, request)
plugin_panels = _plugin.get_custom_panels(
target_model, target_id, request
)
if plugin_panels and type(plugin_panels) is list:
for panel in plugin_panels: