mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix broken calls to offload_task
This commit is contained in:
parent
146335730e
commit
0e0ba66b9a
@ -13,6 +13,7 @@ import InvenTree.helpers
|
|||||||
|
|
||||||
from plugin.helpers import MixinImplementationError, MixinNotImplementedError, render_template
|
from plugin.helpers import MixinImplementationError, MixinNotImplementedError, render_template
|
||||||
from plugin.models import PluginConfig, PluginSetting
|
from plugin.models import PluginConfig, PluginSetting
|
||||||
|
from plugin.registry import registry
|
||||||
from plugin.urls import PLUGIN_BASE
|
from plugin.urls import PLUGIN_BASE
|
||||||
|
|
||||||
|
|
||||||
@ -204,7 +205,7 @@ class ScheduleMixin:
|
|||||||
|
|
||||||
Schedule.objects.create(
|
Schedule.objects.create(
|
||||||
name=task_name,
|
name=task_name,
|
||||||
func='plugin.registry.call_function',
|
func=registry.call_plugin_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),
|
||||||
|
@ -7,7 +7,7 @@ from rest_framework.views import APIView
|
|||||||
|
|
||||||
from InvenTree.tasks import offload_task
|
from InvenTree.tasks import offload_task
|
||||||
|
|
||||||
from plugin import registry
|
from plugin.registry import registry
|
||||||
from stock.models import StockItem, StockLocation
|
from stock.models import StockItem, StockLocation
|
||||||
|
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ class LocatePluginView(APIView):
|
|||||||
try:
|
try:
|
||||||
StockItem.objects.get(pk=item_pk)
|
StockItem.objects.get(pk=item_pk)
|
||||||
|
|
||||||
offload_task(registry.call_function, plugin, 'locate_stock_item', item_pk)
|
offload_task(registry.call_plugin_function, plugin, 'locate_stock_item', item_pk)
|
||||||
|
|
||||||
data['item'] = item_pk
|
data['item'] = item_pk
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ class LocatePluginView(APIView):
|
|||||||
try:
|
try:
|
||||||
StockLocation.objects.get(pk=location_pk)
|
StockLocation.objects.get(pk=location_pk)
|
||||||
|
|
||||||
offload_task(registry.call_function, plugin, 'locate_stock_location', location_pk)
|
offload_task(registry.call_plugin_function, plugin, 'locate_stock_location', location_pk)
|
||||||
|
|
||||||
data['location'] = location_pk
|
data['location'] = location_pk
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user