Move events.py to the plugin app

This commit is contained in:
Oliver 2022-01-07 22:31:10 +11:00
parent 63eb49777a
commit a604d85f0f

View File

@ -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.