Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
2305 |
-
|
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,
|