mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
commit
402104448f
@ -180,7 +180,7 @@ class InvenTreeConfig(AppConfig):
|
||||
|
||||
# not all needed variables set
|
||||
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
|
||||
return
|
||||
|
||||
|
@ -11,6 +11,7 @@ import pkgutil
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import AppRegistryNotReady
|
||||
from django.db.utils import IntegrityError
|
||||
|
||||
|
||||
# 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)
|
||||
|
||||
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))
|
||||
# endregion
|
||||
|
||||
|
@ -77,9 +77,11 @@ class PluginDetailAPITest(InvenTreeAPITestCase):
|
||||
fixtures = PluginConfig.objects.all()
|
||||
|
||||
# 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:
|
||||
registry.reload_plugins()
|
||||
fixtures = PluginConfig.objects.all()
|
||||
print(f'Reloaded plugins - now {len(fixtures)} entries found')
|
||||
|
||||
print([str(a) for a in fixtures])
|
||||
fixtures = fixtures[0:1]
|
||||
|
Loading…
Reference in New Issue
Block a user