fix: use g.goal.content instead of g.goal_content

This commit is contained in:
hmo
2026-04-28 09:22:21 +08:00
parent c8df4d84a0
commit 4f6aea66f2
+1 -1
View File
@@ -664,7 +664,7 @@ def export_pdf(plan_id):
goals_text_parts = [] goals_text_parts = []
for g in student_goals_list: for g in student_goals_list:
if g.status != "已完成": if g.status != "已完成":
goals_text_parts.append(f"- **{g.goal.name}**\n 内容:{g.goal_content or '未提供具体内容'}") goals_text_parts.append(f"- **{g.goal.name}**\n 内容:{g.goal.content if g.goal else '未提供具体内容'}")
goals_text = "\n".join(goals_text_parts) if goals_text_parts else "(无)" goals_text = "\n".join(goals_text_parts) if goals_text_parts else "(无)"
rendered_report = rendered_report.replace("{student_goals}", goals_text) rendered_report = rendered_report.replace("{student_goals}", goals_text)