diff --git a/InvenTree/plugin/events.py b/InvenTree/plugin/events.py index 651ac71590..f777621a45 100644 --- a/InvenTree/plugin/events.py +++ b/InvenTree/plugin/events.py @@ -14,6 +14,7 @@ from django.dispatch.dispatcher import receiver from common.models import InvenTreeSetting +from InvenTree.ready import canAppAccessDatabase from InvenTree.tasks import offload_task from plugin.registry import plugin_registry @@ -30,6 +31,10 @@ def trigger_event(event, *args, **kwargs): and the worker will respond to it later on. """ + if not canAppAccessDatabase(): + logger.debug(f"Ignoring triggered event '{event}' - database not ready") + return + logger.debug(f"Event triggered: '{event}'") offload_task(