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.
This commit is contained in:
Miu Li 2025-06-16 10:26:49 +08:00
parent e50dc7a9d4
commit f7895dc2fe

2
app.py
View File

@ -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)