Bug fix - always allow plugins to register settings

This commit is contained in:
Oliver Walters 2022-01-07 15:41:31 +11:00
parent 794a9e75e8
commit 0ab9b2dbc7

View File

@ -272,14 +272,15 @@ class PluginsRegistry:
self.deactivate_integration_settings() self.deactivate_integration_settings()
def activate_integration_settings(self, plugins): def activate_integration_settings(self, plugins):
from common.models import InvenTreeSetting
if settings.PLUGIN_TESTING or InvenTreeSetting.get_setting('ENABLE_PLUGINS_GLOBALSETTING'): logger.info('Registering IntegrationPlugin global settings')
logger.info('Registering IntegrationPlugin global settings')
for slug, plugin in plugins: self.mixins_settings = {}
if plugin.mixin_enabled('settings'):
plugin_setting = plugin.settings for slug, plugin in plugins:
self.mixins_settings[slug] = plugin_setting if plugin.mixin_enabled('settings'):
plugin_setting = plugin.settings
self.mixins_settings[slug] = plugin_setting
def deactivate_integration_settings(self): def deactivate_integration_settings(self):
@ -290,7 +291,7 @@ class PluginsRegistry:
plugin_settings.update(plugin_setting) plugin_settings.update(plugin_setting)
# clear cache # clear cache
self.mixins_Fsettings = {} self.mixins_settings = {}
def activate_integration_app(self, plugins, force_reload=False): def activate_integration_app(self, plugins, force_reload=False):
"""activate AppMixin plugins - add custom apps and reload """activate AppMixin plugins - add custom apps and reload