fix: use task.files relationship to get source file path

Task model doesn't have file_path attribute directly. Use the files
relationship to access TaskFile.stored_path for source file path.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-02 18:12:22 +08:00
parent bed473cd30
commit 0dcea4a7e7

View File

@@ -596,8 +596,10 @@ async def download_translated_pdf(
try: try:
# Get source file path for images if available # Get source file path for images if available
source_file_path = None source_file_path = None
if task.file_path and Path(task.file_path).exists(): if task.files and len(task.files) > 0:
source_file_path = Path(task.file_path) stored_path = task.files[0].stored_path
if stored_path and Path(stored_path).exists():
source_file_path = Path(stored_path)
success = pdf_generator_service.generate_translated_pdf( success = pdf_generator_service.generate_translated_pdf(
result_json_path=result_json_path, result_json_path=result_json_path,