mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
catch if db not migrated
This commit is contained in:
@ -43,6 +43,8 @@ class PluginConfig(AppConfig):
|
||||
logger.info(f'Found {len(settings.PLUGINS)} plugins!')
|
||||
logger.info(", ".join([a.__module__ for a in settings.PLUGINS]))
|
||||
|
||||
try:
|
||||
logger.info('Starting plugin initialisation')
|
||||
# Initialize integration plugins
|
||||
for plugin in inventree_plugins.load_integration_plugins():
|
||||
# check if package
|
||||
@ -70,10 +72,11 @@ class PluginConfig(AppConfig):
|
||||
|
||||
# activate integrations
|
||||
plugins = settings.INTEGRATION_PLUGINS.items()
|
||||
logger.info(f'Found {len(plugins)} active plugins')
|
||||
|
||||
try:
|
||||
# if plugin settings are enabled enhance the settings
|
||||
if settings.TESTING or InvenTreeSetting.get_setting('ENABLE_PLUGINS_SETTING'):
|
||||
logger.info('Registering IntegrationPlugin settings')
|
||||
for slug, plugin in plugins:
|
||||
if plugin.mixin_enabled('settings'):
|
||||
plugin_setting = plugin.settingspatterns
|
||||
@ -84,6 +87,7 @@ class PluginConfig(AppConfig):
|
||||
|
||||
# if plugin apps are enabled
|
||||
if settings.TESTING or ((not settings.INTEGRATION_APPS_LOADED) and InvenTreeSetting.get_setting('ENABLE_PLUGINS_APP')):
|
||||
logger.info('Registering IntegrationPlugin apps')
|
||||
settings.INTEGRATION_APPS_LOADED = True # ensure this section will not run again
|
||||
apps_changed = False
|
||||
|
||||
|
Reference in New Issue
Block a user