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:
@@ -596,8 +596,10 @@ async def download_translated_pdf(
|
||||
try:
|
||||
# Get source file path for images if available
|
||||
source_file_path = None
|
||||
if task.file_path and Path(task.file_path).exists():
|
||||
source_file_path = Path(task.file_path)
|
||||
if task.files and len(task.files) > 0:
|
||||
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(
|
||||
result_json_path=result_json_path,
|
||||
|
||||
Reference in New Issue
Block a user