avoid recreating file object

This commit is contained in:
Taylor Wilsdon
2025-08-23 10:16:32 -04:00
parent 5d90f8802c
commit d05409a93a
2 changed files with 4 additions and 2 deletions

View File

@@ -1123,9 +1123,11 @@ async def export_doc_to_pdf(
# Upload PDF to Drive
try:
# Reuse the existing BytesIO object by resetting to the beginning
fh.seek(0)
# Create media upload object
media = MediaIoBaseUpload(
io.BytesIO(pdf_content),
fh,
mimetype='application/pdf',
resumable=True
)