fix(file-summary): 修复报告导出下载
This commit is contained in:
@@ -2,11 +2,13 @@ from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from review_agent.models import ExportedSummaryFile, FileSummaryBatch
|
||||
|
||||
|
||||
def _exports_dir(batch: FileSummaryBatch) -> Path:
|
||||
root = Path(batch.work_dir or Path("media") / "file_summary" / batch.batch_no)
|
||||
root = Path(batch.work_dir) if batch.work_dir else Path(settings.MEDIA_ROOT) / "file_summary" / batch.batch_no
|
||||
export_dir = root / "exports"
|
||||
export_dir.mkdir(parents=True, exist_ok=True)
|
||||
return export_dir
|
||||
|
||||
Reference in New Issue
Block a user