feature/implementacion de hub en EFC
This commit is contained in:
@@ -70,14 +70,13 @@ def table_summary(request):
|
||||
status='pending',
|
||||
report_type='cumplimiento'
|
||||
)
|
||||
generate_report_document.delay(report.id)
|
||||
task = generate_report_document.delay(report.id)
|
||||
return Response({
|
||||
"report_id": report.id,
|
||||
"task_id": task.id,
|
||||
"status": report.status,
|
||||
"created_at": report.created_at,
|
||||
# "download_url": report.file.url if report.file else None
|
||||
"download_url": storage_service.get_file_url(report.file) if report.file else None
|
||||
|
||||
"download_url": storage_service.get_file_url(report.file) if report.file else None,
|
||||
}, status=202)
|
||||
|
||||
@api_view(['GET'])
|
||||
@@ -127,7 +126,7 @@ def report_document_download(request, report_id):
|
||||
return Response({"error": "El archivo aún no está disponible"}, status=404)
|
||||
|
||||
ruta = str(report.file)
|
||||
with tempfile.NamedTemporaryFile(delete=False, suffix='.csv') as tmp:
|
||||
with tempfile.NamedTemporaryFile(delete=False, suffix='.xlsx') as tmp:
|
||||
tmp_path = tmp.name
|
||||
|
||||
success = storage_service.download_file(ruta, tmp_path)
|
||||
|
||||
Reference in New Issue
Block a user