diff --git a/backend/src/project/dependencies.py b/backend/src/project/dependencies.py index d6d86da8..0acc939b 100644 --- a/backend/src/project/dependencies.py +++ b/backend/src/project/dependencies.py @@ -22,8 +22,6 @@ async def retrieve_project(project_id: int, async def retrieve_test_files_uuid(project: Project = Depends(retrieve_project)): - if project.test_files_uuid is None: - raise TestsNotFound return project.test_files_uuid diff --git a/backend/src/project/router.py b/backend/src/project/router.py index 20191b5c..49864816 100644 --- a/backend/src/project/router.py +++ b/backend/src/project/router.py @@ -1,4 +1,4 @@ -from typing import Sequence, List +from typing import Sequence, List, Optional from docker import DockerClient from fastapi import APIRouter, Depends, UploadFile, BackgroundTasks @@ -85,7 +85,9 @@ async def list_submissions(project_id: int, @router.get("/{project_id}/test_files") -async def get_test_files(test_files_uuid: str = Depends(retrieve_test_files_uuid)): +async def get_test_files(test_files_uuid: Optional[str] = Depends(retrieve_test_files_uuid)): + if not test_files_uuid: + return [] return get_files_from_dir(tests_path(test_files_uuid))