From f7895dc2fe57d4fbdc79eb6958baa1fb652acf4d Mon Sep 17 00:00:00 2001 From: mxr612 Date: Mon, 16 Jun 2025 10:26:49 +0800 Subject: [PATCH] fix: update scale ID check in download_scale_results endpoint - Changed the scale ID check in the download_scale_results function from "database" to "psychoscales.db" for improved clarity and accuracy in file retrieval. - This adjustment ensures the correct database file is accessed when downloading scale results. --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index e4b68e7..d049d5f 100644 --- a/app.py +++ b/app.py @@ -157,7 +157,7 @@ async def result(request: Request, scale_id: str, db: Session = Depends(get_db)) @app.get("/download/{scale_id}") async def download_scale_results(scale_id: str, db: Session = Depends(get_db)): - if scale_id == "database": + if scale_id == "psychoscales.db": public_path = os.path.join("psychoscales.db") if os.path.isfile(public_path): return FileResponse(public_path)