mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Skip plugin loading for various database admin functions
This commit is contained in:
parent
e1a0261888
commit
9446702d78
@ -39,7 +39,8 @@ def canAppAccessDatabase(allow_test=False):
|
||||
'createsuperuser',
|
||||
'wait_for_db',
|
||||
'prerender',
|
||||
'rebuild',
|
||||
'rebuild_models',
|
||||
'rebuild_thumbnails',
|
||||
'collectstatic',
|
||||
'makemessages',
|
||||
'compilemessages',
|
||||
|
@ -7,7 +7,7 @@ from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from maintenance_mode.core import set_maintenance_mode
|
||||
|
||||
from InvenTree.ready import isImportingData
|
||||
from InvenTree.ready import canAppAccessDatabase
|
||||
from plugin import registry
|
||||
from plugin.helpers import check_git_version, log_error
|
||||
|
||||
@ -20,9 +20,8 @@ class PluginAppConfig(AppConfig):
|
||||
|
||||
def ready(self):
|
||||
if settings.PLUGINS_ENABLED:
|
||||
|
||||
if isImportingData(): # pragma: no cover
|
||||
logger.info('Skipping plugin loading for data import')
|
||||
if not canAppAccessDatabase(allow_test=True):
|
||||
logger.info("Skipping plugin loading sequence")
|
||||
else:
|
||||
logger.info('Loading InvenTree plugins')
|
||||
|
||||
@ -48,3 +47,6 @@ class PluginAppConfig(AppConfig):
|
||||
registry.git_is_modern = check_git_version()
|
||||
if not registry.git_is_modern: # pragma: no cover # simulating old git seems not worth it for coverage
|
||||
log_error(_('Your enviroment has an outdated git version. This prevents InvenTree from loading plugin details.'), 'load')
|
||||
|
||||
else:
|
||||
logger.info("Plugins not enabled - skipping loading sequence")
|
Loading…
Reference in New Issue
Block a user