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:
parent
e50dc7a9d4
commit
f7895dc2fe
2
app.py
2
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user