mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
catch db not loaded
This commit is contained in:
parent
23558e235b
commit
f86bd4dd6b
@ -5,6 +5,7 @@ from typing import OrderedDict
|
||||
|
||||
from django.apps import AppConfig, apps
|
||||
from django.conf import settings
|
||||
from django.db.utils import OperationalError, ProgrammingError
|
||||
|
||||
|
||||
class PluginConfig(AppConfig):
|
||||
@ -14,6 +15,7 @@ class PluginConfig(AppConfig):
|
||||
from common.models import InvenTreeSetting
|
||||
plugins = settings.INTEGRATION_PLUGINS.items()
|
||||
|
||||
try:
|
||||
# if plugin settings are enabled enhance the settings
|
||||
if settings.TESTING or InvenTreeSetting.get_setting('ENABLE_PLUGINS_SETTING'):
|
||||
for slug, plugin in plugins:
|
||||
@ -44,3 +46,6 @@ class PluginConfig(AppConfig):
|
||||
apps.apps_ready = apps.models_ready = apps.loading = apps.ready = False
|
||||
apps.clear_cache()
|
||||
apps.populate(settings.INSTALLED_APPS)
|
||||
except (OperationalError, ProgrammingError):
|
||||
# Exception if the database has not been migrated yet
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user