prthm11 commited on
Commit
aaa6ff7
·
verified ·
1 Parent(s): 09c1895

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -2300,9 +2300,9 @@ def download_sb3(project_id):
2300
 
2301
  @app.route("/download_pdf/<project_id>", methods=["GET"])
2302
  def download_pdf(project_id):
2303
- pdf_path = GEN_PROJECT_DIR / f"{project_id}.pdf"
2304
- # if not pdf_path.exists():
2305
- # return jsonify({"error": "Scratch project file not found"}), 404
2306
 
2307
  return send_file(
2308
  pdf_path,
 
2300
 
2301
  @app.route("/download_pdf/<project_id>", methods=["GET"])
2302
  def download_pdf(project_id):
2303
+ pdf_path = GEN_PROJECT_DIR / project_id / f"{project_id}.pdf"
2304
+ if not pdf_path.exists():
2305
+ return jsonify({"error": "Scratch project file not found"}), 404
2306
 
2307
  return send_file(
2308
  pdf_path,