diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 1b92757fda..2ed421d2ac 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -43,6 +43,7 @@ from .views import AppearanceSelectView, SettingCategorySelectView from .views import DynamicJsView from common.views import SettingEdit, UserSettingEdit +from common.models import InvenTreeSetting from .api import InfoView, NotFoundView from .api import ActionPluginView @@ -125,11 +126,12 @@ translated_javascript_urls = [ ] # Integration plugin urls -integration_plugins = settings.INTEGRATION_PLUGINS interation_urls = [] -for plugin in integration_plugins: - if plugin.mixin_enabled('urls'): - interation_urls.append(plugin.urlpatterns) +if InvenTreeSetting.get_setting('ENABLE_PLUGINS_URL'): + integration_plugins = settings.INTEGRATION_PLUGINS + for plugin in integration_plugins: + if plugin.mixin_enabled('urls'): + interation_urls.append(plugin.urlpatterns) urlpatterns = [ url(r'^part/', include(part_urls)), diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index 848e4e9b0a..8bdc48bbb1 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -854,7 +854,12 @@ class InvenTreeSetting(BaseInvenTreeSetting): 'default': '', 'choices': settings_group_options }, - + 'ENABLE_PLUGINS_URL': { + 'name': _('Enable URL integration'), + 'description': _('Enable plugins to add URL routes'), + 'default': False, + 'validator': bool, + }, 'ENABLE_PLUGINS_NAVIGATION': { 'name': _('Enable navigation integration'), 'description': _('Enable plugins to integrate into navigation'), diff --git a/InvenTree/templates/InvenTree/settings/plugin.html b/InvenTree/templates/InvenTree/settings/plugin.html index 8b4f03bbea..19ab02761a 100644 --- a/InvenTree/templates/InvenTree/settings/plugin.html +++ b/InvenTree/templates/InvenTree/settings/plugin.html @@ -16,6 +16,7 @@