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