mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 04:25:42 +00:00
Disable panel return if plugin integration is not enabled
This commit is contained in:
@ -17,6 +17,7 @@ from rest_framework.views import APIView
|
|||||||
|
|
||||||
import plugin.serializers as PluginSerializers
|
import plugin.serializers as PluginSerializers
|
||||||
from common.api import GlobalSettingsPermissions
|
from common.api import GlobalSettingsPermissions
|
||||||
|
from common.settings import get_global_setting
|
||||||
from InvenTree.api import MetadataView
|
from InvenTree.api import MetadataView
|
||||||
from InvenTree.filters import SEARCH_ORDER_FILTER
|
from InvenTree.filters import SEARCH_ORDER_FILTER
|
||||||
from InvenTree.mixins import (
|
from InvenTree.mixins import (
|
||||||
@ -429,10 +430,13 @@ class PluginPanelList(APIView):
|
|||||||
|
|
||||||
panels = []
|
panels = []
|
||||||
|
|
||||||
|
if get_global_setting('ENABLE_PLUGINS_INTERFACE'):
|
||||||
# Extract all plugins from the registry which provide custom panels
|
# Extract all plugins from the registry which provide custom panels
|
||||||
for _plugin in registry.with_mixin('ui', active=True):
|
for _plugin in registry.with_mixin('ui', active=True):
|
||||||
# Allow plugins to fill this data out
|
# 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:
|
if plugin_panels and type(plugin_panels) is list:
|
||||||
for panel in plugin_panels:
|
for panel in plugin_panels:
|
||||||
|
Reference in New Issue
Block a user