Skip to content

Commit

Permalink
fix: Return 204 response
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Jan 6, 2025
1 parent de9d0a3 commit b1f2bef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ai/backend/manager/api/container_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def associate_with_group(request: web.Request, params: Any) -> web.Respons
except IntegrityError:
raise GenericBadRequest("Association already exists.")

return web.json_response({})
return web.Response(status=204)


@server_status_required(READ_ALLOWED)
Expand Down Expand Up @@ -81,7 +81,7 @@ async def disassociate_with_group(request: web.Request, params: Any) -> web.Resp
if result.rowcount == 0:
raise ContainerRegistryNotFound()

return web.json_response({})
return web.Response(status=204)


def create_app(
Expand Down
4 changes: 2 additions & 2 deletions tests/manager/api/test_container_registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async def test_associate_container_registry_with_group(
if association_exist:
assert resp.status == 400
else:
assert resp.status == 200
assert resp.status == 204


@pytest.mark.asyncio
Expand Down Expand Up @@ -153,6 +153,6 @@ async def test_disassociate_container_registry_with_group(
association_exist = "association_container_registries_groups" in extra_fixtures

if association_exist:
assert resp.status == 200
assert resp.status == 204
else:
assert resp.status == 404

0 comments on commit b1f2bef

Please sign in to comment.