Skip to content

Commit eb05b07

Browse files
authored
Merge pull request #629 from ral-facilities/fix-runtime-error-when-no-spares-#628
Replace JSONResponse with Response to fix runtime error #628
2 parents 69bac39 + 8a0333c commit eb05b07

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

inventory_management_system_api/routers/v1/setting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from typing import Annotated
1212

1313
from fastapi import APIRouter, Depends, status
14-
from fastapi.responses import JSONResponse
14+
from fastapi.responses import Response
1515

1616
from inventory_management_system_api.schemas.setting import SparesDefinitionSchema
1717
from inventory_management_system_api.services.setting import SettingService
@@ -37,6 +37,6 @@ def get_spares_definition(setting_service: SettingServiceDep):
3737
setting = setting_service.get_spares_definition()
3838

3939
if setting is None:
40-
return JSONResponse(status_code=status.HTTP_204_NO_CONTENT, content=None)
40+
return Response(status_code=status.HTTP_204_NO_CONTENT, content=None)
4141

4242
return SparesDefinitionSchema(**setting.model_dump())

test/unit/repositories/test_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ def check_count_in_catalogue_item_with_system_type_one_of(self) -> None:
647647
],
648648
session=self.mock_session,
649649
)
650-
assert self._expected_count == self._obtained_count
650+
assert self._obtained_count == self._expected_count
651651

652652

653653
class TestCountInCatalogueItemWithSystemTypeOneOf(CountInCatalogueItemWithSystemTypeOneOfDSL):

0 commit comments

Comments
 (0)