Commit 47d31005 authored by ibuler's avatar ibuler

[Update] 修复执行任务的bug

parent 2dbd6b6f
...@@ -14,6 +14,7 @@ from django.utils.translation import ugettext_lazy as _ ...@@ -14,6 +14,7 @@ from django.utils.translation import ugettext_lazy as _
from django_celery_beat.models import PeriodicTask from django_celery_beat.models import PeriodicTask
from common.utils import get_signer, get_logger from common.utils import get_signer, get_logger
from orgs.utils import set_to_root_org
from ..celery.utils import delete_celery_periodic_task, \ from ..celery.utils import delete_celery_periodic_task, \
create_or_update_celery_periodic_tasks, \ create_or_update_celery_periodic_tasks, \
disable_celery_periodic_task disable_celery_periodic_task
...@@ -83,6 +84,7 @@ class Task(models.Model): ...@@ -83,6 +84,7 @@ class Task(models.Model):
return self.history.all() return self.history.all()
def run(self, record=True): def run(self, record=True):
set_to_root_org()
if self.latest_adhoc: if self.latest_adhoc:
return self.latest_adhoc.run(record=record) return self.latest_adhoc.run(record=record)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment