diff --git a/InvenTree/InvenTree/events.py b/InvenTree/plugin/events.py similarity index 91% rename from InvenTree/InvenTree/events.py rename to InvenTree/plugin/events.py index 2286f57d7b..703fe71d9c 100644 --- a/InvenTree/InvenTree/events.py +++ b/InvenTree/plugin/events.py @@ -19,7 +19,7 @@ logger = logging.getLogger('inventree') def trigger_event(event, *args, **kwargs): """ - Trigger an even with optional arguments. + Trigger an event with optional arguments. This event will be stored in the database, and the worker will respond to it later on. @@ -28,12 +28,13 @@ def trigger_event(event, *args, **kwargs): logger.debug(f"Event triggered: '{event}'") offload_task( - 'InvenTree.events.process_event', + 'plugin.events.process_event', event, *args, **kwargs, ) + def process_event(event, *args, **kwargs): """ Respond to a triggered event.