Refactorizacion de PDFs y cambio de biblioteca backend 1.0.19 v2

This commit is contained in:
2025-11-24 18:13:01 -03:00
parent 4428d17b27
commit b304fbbb86

View File

@@ -1783,7 +1783,11 @@ def export_inspection_to_pdf(
pdf_url = f"{S3_ENDPOINT}/{S3_PDF_BUCKET}/{s3_key}"
inspection.pdf_url = pdf_url
db.commit()
return {"pdf_url": pdf_url}
# Descargar el PDF directamente
buffer.seek(0)
return StreamingResponse(buffer, media_type="application/pdf", headers={
"Content-Disposition": f"attachment; filename={filename}"
})
# ============= HEALTH CHECK =============