mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Move events.py to the plugin app
This commit is contained in:
parent
63eb49777a
commit
a604d85f0f
@ -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.
|
Loading…
Reference in New Issue
Block a user