From 8f10ef817c6ecd258ae1ff68d9b7d74bd37e1bca Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 16 Mar 2022 14:47:27 +0100 Subject: [PATCH] add setting for reload --- InvenTree/common/models.py | 7 +++++++ InvenTree/plugin/apps.py | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index 2b84918e82..766ef16703 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -1002,6 +1002,13 @@ class InvenTreeSetting(BaseInvenTreeSetting): 'validator': bool, }, + 'PLUGIN_ON_STARTUP': { + 'name': _('Check plugins on startup'), + 'description': _('Check that all plugins are installed on startup - enable in container enviroments'), + 'default': False, + 'validator': bool, + 'requires_restart': True, + }, # Settings for plugin mixin features 'ENABLE_PLUGINS_URL': { 'name': _('Enable URL integration'), diff --git a/InvenTree/plugin/apps.py b/InvenTree/plugin/apps.py index 6ebaf2215a..93f1b89b6e 100644 --- a/InvenTree/plugin/apps.py +++ b/InvenTree/plugin/apps.py @@ -30,9 +30,11 @@ class PluginAppConfig(AppConfig): if not registry.is_loading: # this is the first startup + from common.models import InvenTreeSetting - # make sure all plugins are installed - registry.install_plugin_file() + if InvenTreeSetting.get_setting('PLUGIN_ON_STARTUP'): + # make sure all plugins are installed + registry.install_plugin_file() # get plugins and init them registry.collect_plugins()