diff --git a/pyproject.toml b/pyproject.toml index 745de02..956dd76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,14 +39,11 @@ dev = [ "pytest", "pytest-cov", "ruff", - # "sphinx-autobuild", - # "sphinx-copybutton", - # "sphinx-design", "tox-direct", "types-mock", "pytest-asyncio", - "httpx", - # "pydata-sphinx-theme < 0.10.1", + # https://github.com/encode/httpx/blob/master/CHANGELOG.md#0270-21st-february-2024 + "httpx~=0.26.0", "setuptools_scm[toml]>=6.2" ] diff --git a/src/pato/crud/collections.py b/src/pato/crud/collections.py index f607e1f..5ea1479 100644 --- a/src/pato/crud/collections.py +++ b/src/pato/crud/collections.py @@ -80,7 +80,7 @@ def get_tomograms( _job_status_description.label("status"), ) .select_from(ProcessingJob) - .join(AutoProcProgram) + .outerjoin(AutoProcProgram) .outerjoin(Tomogram) .filter(ProcessingJob.dataCollectionId == collectionId) .order_by(ProcessingJob.processingJobId.desc()) diff --git a/src/pato/models/response.py b/src/pato/models/response.py index 9cf08f3..6f39b5c 100644 --- a/src/pato/models/response.py +++ b/src/pato/models/response.py @@ -385,7 +385,7 @@ class AutoProcProgram(OrmBaseModel): class ProcessingJobResponse(OrmBaseModel): - AutoProcProgram: AutoProcProgram + AutoProcProgram: Optional[AutoProcProgram] ProcessingJob: ProcessingJob status: str diff --git a/tests/collections/test_tomogram.py b/tests/collections/test_tomogram.py index 67c7e39..d99dff0 100644 --- a/tests/collections/test_tomogram.py +++ b/tests/collections/test_tomogram.py @@ -16,3 +16,10 @@ def test_get_no_tomogram(mock_permissions, client): resp = client.get("/dataCollections/6017413/tomograms") assert resp.status_code == 200 assert resp.json()["items"][1]["Tomogram"] is None + + +def test_get_no_autoproc(mock_permissions, client): + """Get tomograms with no linked autoprocessing programs""" + resp = client.get("/dataCollections/6017406/tomograms") + assert resp.status_code == 200 + assert resp.json()["total"] == 29