new task bug fixed

This commit is contained in:
2024-10-24 21:23:08 +03:30
parent f0e02c3c5f
commit 37cdb1675d
2 changed files with 4 additions and 2 deletions

View File

@@ -107,7 +107,9 @@ class AsyncronWorker:
from .models import Task
for func in Task.registered_tasks.values():
task = func.task
if not task.pk: task.pk = Task.objects.get( name = task.name ).pk
if not task.pk:
try: task.pk = Task.objects.get( name = task.name ).pk
except Task.DoesNotExist: pass #It's a new one, it's fine.
self.attach_django_signals()