Skip to content

Commit

Permalink
♻️ aiohttp deprecation: Using web.json_response to return 2XX r…
Browse files Browse the repository at this point in the history
…esponses instead of raising `HttpException` (#6829)
  • Loading branch information
pcrespov authored Nov 26, 2024
1 parent bca766c commit 5fcb5cf
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
parse_request_query_parameters_as,
)
from servicelib.logging_utils import log_context
from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON
from settings_library.s3 import S3Settings

from . import sts
Expand Down Expand Up @@ -79,8 +78,10 @@ async def _copy_folders_from_project(
task_progress=task_progress,
)

raise web.HTTPCreated(
text=json_dumps(body.destination), content_type=MIMETYPE_APPLICATION_JSON
return web.json_response(
{"data": jsonable_encoder(body.destination)},
status=status.HTTP_201_CREATED,
dumps=json_dumps,
)


Expand Down

0 comments on commit 5fcb5cf

Please sign in to comment.