fix(ops): 修复任务schedule属性的bug

pull/4783/head^2
ibuler 4 years ago committed by xinwen
parent 82dd1c35ea
commit 84e4238848

@ -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…
Cancel
Save