From a604d85f0f83afa413061bb5cb0f14c0ab6805b2 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 7 Jan 2022 22:31:10 +1100 Subject: [PATCH] Move events.py to the plugin app --- InvenTree/{InvenTree => plugin}/events.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename InvenTree/{InvenTree => plugin}/events.py (91%) 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.