Merge pull request #1737 from jumpserver/dev

Dev
pull/2638/head^2
老广 2018-08-24 12:12:38 +08:00 committed by GitHub
commit 9f96f1c537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@ from django.utils.translation import ugettext_lazy as _
from django_celery_beat.models import PeriodicTask
from common.utils import get_signer, get_logger
from orgs.utils import set_to_root_org
from ..celery.utils import delete_celery_periodic_task, \
create_or_update_celery_periodic_tasks, \
disable_celery_periodic_task
@ -83,6 +84,7 @@ class Task(models.Model):
return self.history.all()
def run(self, record=True):
set_to_root_org()
if self.latest_adhoc:
return self.latest_adhoc.run(record=record)
else: