Remove explicit Response for endpoints returning HTTP 204 status code

This commit is contained in:
grossmj committed 2022-07-16 00:12:18 +02:00
1 parent 5b478fc331
commit fc6aeb715a
29 files changed
+162 -302

No files matched your search

+2 -5
View File
@@ -129,7 +129,7 @@ async def get_image(
async def delete_image(
image_path: str,
images_repo: ImagesRepository = Depends(get_repository(ImagesRepository)),
) -> Response:
) -> None:
"""
Delete an image.
"""
@@ -159,16 +159,13 @@ async def delete_image(
if not success:
raise ControllerError(f"Image '{image_path}' could not be deleted")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/prune", status_code=status.HTTP_204_NO_CONTENT)
async def prune_images(
images_repo: ImagesRepository = Depends(get_repository(ImagesRepository)),
) -> Response:
) -> None:
"""
Prune images not attached to any template.
"""
await images_repo.prune_images()
return Response(status_code=status.HTTP_204_NO_CONTENT)