Use SharedUploadedFile's new open() method.

This commit is contained in:
Roberto Rosario
2015-07-07 01:28:06 -04:00
parent 01cf7780c0
commit a59234bb83
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -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()