Skip to content

Commit

Permalink
link the document to the related import task
Browse files Browse the repository at this point in the history
  • Loading branch information
goose-life committed Mar 5, 2024
1 parent dff0850 commit 0864982
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions indigo_app/views/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ def create_and_import_document(self, task):
document.created_by_user = self.request.user
document.save()

# link it to the related import task
import_task = Task.objects.filter(work=task.work, code='import-content',
timeline_date=task.timeline_date or task.work.get_import_date()).first()
if import_task:
import_task.document = document
import_task.save()

# do the import
importer = plugins.for_document('importer', document)
upload = UploadedFile(file=task.output_file.file, name=task.output_file.filename, size=task.output_file.size,
Expand Down

0 comments on commit 0864982

Please sign in to comment.