Better tasks api endpoint

This commit is contained in:
Michael Shamoon
2022-05-23 15:22:14 -07:00
parent 61eb459e9e
commit 09f637a4cb
4 changed files with 35 additions and 56 deletions

View File

@@ -8,7 +8,7 @@ def init_paperless_tasks(apps, schema_editor):
PaperlessTask = apps.get_model("documents", "PaperlessTask")
Task = apps.get_model("django_q", "Task")
for task in Task.objects.all():
for task in Task.objects.filter(func="documents.tasks.consume_file"):
if not hasattr(task, "paperlesstask"):
paperlesstask = PaperlessTask.objects.create(
attempted_task=task,