Skip to content

Commit

Permalink
download submissions route updated which uses function using threads
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Jul 20, 2023
1 parent 41fe0fe commit b392002
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/backend/app/submission/submission_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)


Expand Down

0 comments on commit b392002

Please sign in to comment.