Replace usages of os.rename with shutil.move to properly handle cases where the source and dest arent't on the same filesystem

This commit is contained in:
Trenton Holmes
2023-04-30 17:55:25 -07:00
committed by Trenton H
parent 02a7112b1a
commit e34b8c4b1f
4 changed files with 13 additions and 9 deletions

View File

@@ -10,8 +10,8 @@ from documents.models import Document
from documents.parsers import get_parser_class_for_mime_type
def _process_document(doc_in):
document: Document = Document.objects.get(id=doc_in)
def _process_document(doc_id):
document: Document = Document.objects.get(id=doc_id)
parser_class = get_parser_class_for_mime_type(document.mime_type)
if parser_class: