mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-03 05:48:47 +00:00
commit
402104448f
@ -180,7 +180,7 @@ class InvenTreeConfig(AppConfig):
|
|||||||
|
|
||||||
# not all needed variables set
|
# not all needed variables set
|
||||||
if set_variables < 3:
|
if set_variables < 3:
|
||||||
logger.warn('Not all required settings for adding a user on startup are present:\nINVENTREE_SET_USER, INVENTREE_SET_EMAIL, INVENTREE_SET_PASSWORD')
|
logger.warn('Not all required settings for adding a user on startup are present:\nINVENTREE_ADMIN_USER, INVENTREE_ADMIN_EMAIL, INVENTREE_ADMIN_PASSWORD')
|
||||||
settings.USER_ADDED = True
|
settings.USER_ADDED = True
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import pkgutil
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.exceptions import AppRegistryNotReady
|
from django.core.exceptions import AppRegistryNotReady
|
||||||
|
from django.db.utils import IntegrityError
|
||||||
|
|
||||||
|
|
||||||
# region logging / errors
|
# region logging / errors
|
||||||
@ -85,6 +86,9 @@ def handle_error(error, do_raise: bool = True, do_log: bool = True, log_name: st
|
|||||||
log_error({package_name: str(error)}, **log_kwargs)
|
log_error({package_name: str(error)}, **log_kwargs)
|
||||||
|
|
||||||
if do_raise:
|
if do_raise:
|
||||||
|
# do a straight raise if we are playing with enviroment variables at execution time, ignore the broken sample
|
||||||
|
if settings.TESTING_ENV and package_name != 'integration.broken_sample' and isinstance(error, IntegrityError):
|
||||||
|
raise error
|
||||||
raise IntegrationPluginError(package_name, str(error))
|
raise IntegrationPluginError(package_name, str(error))
|
||||||
# endregion
|
# endregion
|
||||||
|
|
||||||
|
@ -77,9 +77,11 @@ class PluginDetailAPITest(InvenTreeAPITestCase):
|
|||||||
fixtures = PluginConfig.objects.all()
|
fixtures = PluginConfig.objects.all()
|
||||||
|
|
||||||
# check if plugins were registered -> in some test setups the startup has no db access
|
# check if plugins were registered -> in some test setups the startup has no db access
|
||||||
|
print(f'[PLUGIN-TEST] currently {len(fixtures)} plugin entries found')
|
||||||
if not fixtures:
|
if not fixtures:
|
||||||
registry.reload_plugins()
|
registry.reload_plugins()
|
||||||
fixtures = PluginConfig.objects.all()
|
fixtures = PluginConfig.objects.all()
|
||||||
|
print(f'Reloaded plugins - now {len(fixtures)} entries found')
|
||||||
|
|
||||||
print([str(a) for a in fixtures])
|
print([str(a) for a in fixtures])
|
||||||
fixtures = fixtures[0:1]
|
fixtures = fixtures[0:1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user