diff --git a/src/backend/app/submission/submission_routes.py b/src/backend/app/submission/submission_routes.py index 72b6f0b1c2..0924788942 100644 --- a/src/backend/app/submission/submission_routes.py +++ b/src/backend/app/submission/submission_routes.py @@ -19,6 +19,7 @@ from fastapi import APIRouter, Depends from fastapi.logger import logger as logger from sqlalchemy.orm import Session +from fastapi.responses import FileResponse from ..db import database from . import submission_crud @@ -97,6 +98,10 @@ async def download_submission( task_id: The ID of the task. This parameter is optional. If task_id is provided, this endpoint returns the submissions made for this task. """ + if not (task_id and export_json): + file = submission_crud.download_submission_for_project(db, project_id) + return FileResponse(file) + return submission_crud.download_submission(db, project_id, task_id, export_json)