Also allow non string references

Fixes #3005
This commit is contained in:
Matthias Mair 2022-05-16 17:29:14 +02:00
parent 432fd9b8e6
commit 9ec626b650

View File

@ -68,6 +68,10 @@ def offload_task(taskname, *args, force_sync=False, **kwargs):
import importlib
from InvenTree.status import is_worker_running
# make sure the taskname is a string
if not isinstance(taskname, str):
taskname = str(taskname)
if is_worker_running() and not force_sync: # pragma: no cover
# Running as asynchronous task
try: