mirror of https://github.com/jumpserver/jumpserver
fix(ops): 修复任务schedule属性的bug
parent
5a87634c26
commit
2190db1bb5
|
@ -95,10 +95,8 @@ class PeriodTaskModelMixin(models.Model):
|
|||
@property
|
||||
def schedule(self):
|
||||
from django_celery_beat.models import PeriodicTask
|
||||
try:
|
||||
return PeriodicTask.objects.get(name=str(self))
|
||||
except PeriodicTask.DoesNotExist:
|
||||
return None
|
||||
name = self.get_register_task()[0]
|
||||
return PeriodicTask.objects.filter(name=name).first()
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
|
Loading…
Reference in New Issue