Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
provinzkraut committed Sep 23, 2024
1 parent 62c89c8 commit 2632904
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions litestar/handlers/http_handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,21 +710,16 @@ async def _get_response_data(self, request: Request) -> tuple[Any, DependencyCle
parameter_model = self._get_kwargs_model_for_route(request.scope["path_params"].keys())

if parameter_model.has_kwargs and self.signature_model:
kwargs = parameter_model.to_kwargs(connection=request)
try:
kwargs = await parameter_model.to_kwargs(connection=request)
except SerializationException as e:
raise ClientException(str(e)) from e

if "data" in kwargs:
try:
data = await kwargs["data"]
except SerializationException as e:
raise ClientException(str(e)) from e
data = kwargs["data"]

if data is Empty:
del kwargs["data"]
else:
kwargs["data"] = data

if "body" in kwargs:
kwargs["body"] = await kwargs["body"]

if parameter_model.dependency_batches:
cleanup_group = await parameter_model.resolve_dependencies(request, kwargs)
Expand Down
2 changes: 1 addition & 1 deletion litestar/handlers/websocket_handlers/route_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async def handle(self, connection: WebSocket[Any, Any, Any]) -> None:
cleanup_group: DependencyCleanupGroup | None = None

if handler_parameter_model.has_kwargs and self.signature_model:
parsed_kwargs = handler_parameter_model.to_kwargs(connection=connection)
parsed_kwargs = await handler_parameter_model.to_kwargs(connection=connection)

if handler_parameter_model.dependency_batches:
cleanup_group = await handler_parameter_model.resolve_dependencies(connection, parsed_kwargs)
Expand Down

0 comments on commit 2632904

Please sign in to comment.