mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Fix - needs a global function to schedule
This commit is contained in:
parent
519a1009ab
commit
ae016730f8
@ -202,7 +202,7 @@ class ScheduleMixin:
|
|||||||
|
|
||||||
Schedule.objects.create(
|
Schedule.objects.create(
|
||||||
name=task_name,
|
name=task_name,
|
||||||
func='plugin.registry.registry.call_plugin_function',
|
func='plugin.registry.call_function',
|
||||||
args=f"'{slug}', '{func_name}'",
|
args=f"'{slug}', '{func_name}'",
|
||||||
schedule_type=task['schedule'],
|
schedule_type=task['schedule'],
|
||||||
minutes=task.get('minutes', None),
|
minutes=task.get('minutes', None),
|
||||||
|
@ -73,7 +73,7 @@ class PluginsRegistry:
|
|||||||
|
|
||||||
plugin_func = getattr(plugin, func)
|
plugin_func = getattr(plugin, func)
|
||||||
|
|
||||||
plugin_func(*args, **kwargs)
|
return plugin_func(*args, **kwargs)
|
||||||
|
|
||||||
# region public functions
|
# region public functions
|
||||||
# region loading / unloading
|
# region loading / unloading
|
||||||
@ -573,3 +573,7 @@ class PluginsRegistry:
|
|||||||
|
|
||||||
|
|
||||||
registry = PluginsRegistry()
|
registry = PluginsRegistry()
|
||||||
|
|
||||||
|
def call_function(plugin_name, function_name):
|
||||||
|
""" Global helper function to call a specific member function of a plugin """
|
||||||
|
return registry.call_plugin_function(plugin_name, function_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user