diff --git a/backend/benefit/applications/api/v1/application_batch_views.py b/backend/benefit/applications/api/v1/application_batch_views.py index 90d0c15530..a918c1737d 100755 --- a/backend/benefit/applications/api/v1/application_batch_views.py +++ b/backend/benefit/applications/api/v1/application_batch_views.py @@ -178,7 +178,7 @@ def talpa_export_batch(self, request, *args, **kwargs) -> StreamingHttpResponse: " later" ) }, - status=status.HTTP_400_BAD_REQUEST, + status=status.HTTP_404_NOT_FOUND, ) applications = Application.objects.filter(batch__in=approved_batches).order_by( "company__name", "application_number" diff --git a/backend/benefit/applications/tests/test_application_batch_api.py b/backend/benefit/applications/tests/test_application_batch_api.py index dc16718543..bfc5c3f2b5 100755 --- a/backend/benefit/applications/tests/test_application_batch_api.py +++ b/backend/benefit/applications/tests/test_application_batch_api.py @@ -819,7 +819,7 @@ def test_application_batches_talpa_export(anonymous_client, application_batch): application_batch.status = ApplicationBatchStatus.DECIDED_REJECTED fill_as_valid_batch_completion_and_save(application_batch) response = anonymous_client.get(reverse("v1:applicationbatch-talpa-export-batch")) - assert response.status_code == 400 + assert response.status_code == 404 assert "There is no available application to export" in response.data["detail"] application_batch.status = ApplicationBatchStatus.DECIDED_ACCEPTED