diff --git a/mayan/apps/documents/tasks.py b/mayan/apps/documents/tasks.py index 89b1cefe5b..b71f12a0e0 100644 --- a/mayan/apps/documents/tasks.py +++ b/mayan/apps/documents/tasks.py @@ -49,7 +49,7 @@ def task_upload_new_version(document_id, shared_uploaded_file_id, user_id, comme else: user = None - with File(file=shared_file.file) as file_object: + with shared_file.open() as file_object: try: document_version = DocumentVersion(document=document, comment=comment or '', file=file_object) document_version.save(_user=user) diff --git a/mayan/apps/sources/tasks.py b/mayan/apps/sources/tasks.py index 2d1747c66b..b0124dde39 100644 --- a/mayan/apps/sources/tasks.py +++ b/mayan/apps/sources/tasks.py @@ -38,7 +38,7 @@ def task_source_upload_document(label, document_type_id, shared_uploaded_file_id else: user = None - with File(file=shared_uploaded_file.file) as file_object: + with shared_uploaded_file.open() as file_object: source.upload_document(description=description, document_type=document_type, expand=expand, file_object=file_object, label=label, language=language, metadata_dict_list=metadata_dict_list, user=user) shared_uploaded_file.delete()