Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
provinzkraut committed Jan 11, 2025
1 parent e1302a1 commit c2fc97d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion litestar/_openapi/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def set_success_response_headers(self, response: OpenAPIResponse) -> None:

response.headers[response_header.name] = header

if cookies := self.route_handler.resolve_response_cookies():
if cookies := self.route_handler.response_cookies:
response.headers["Set-Cookie"] = OpenAPIHeader(
schema=Schema(
all_of=[create_cookie_schema(cookie=cookie) for cookie in sorted(cookies, key=attrgetter("key"))]
Expand Down
2 changes: 1 addition & 1 deletion litestar/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def _get_default_plugins(plugins: list[PluginProtocol]) -> list[PluginProtocol]:
if not pydantic_plugin_found and not pydantic_serialization_plugin_found:
plugins.append(PydanticDIPlugin())
with suppress(MissingDependencyException):
from litestar.contrib.attrs import AttrsSchemaPlugin
from litestar.plugins.attrs import AttrsSchemaPlugin

pre_configured = any(isinstance(plugin, AttrsSchemaPlugin) for plugin in plugins)
if not pre_configured:
Expand Down
2 changes: 1 addition & 1 deletion litestar/handlers/http_handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def on_registration(self, route: BaseRoute, app: Litestar) -> None:
self._default_response_handler, self._response_type_handler = self._create_response_handlers(
media_type=self.media_type,
response_class=self.response_class,
cookies=self.resolve_response_cookies(),
cookies=self.response_cookies,
headers=self.response_headers,
type_encoders=self.type_encoders,
return_type=self.parsed_fn_signature.return_type,
Expand Down
6 changes: 3 additions & 3 deletions litestar/handlers/http_handlers/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def patch(
type_decoders: TypeDecodersSequence | None = None,
type_encoders: TypeEncodersMap | None = None,
handler_class: type[HTTPRouteHandler] = HTTPRouteHandler,
handler_class: type[HTTPRouteHandler] = HTTPRouteHandler,**kwargs: Any,
**kwargs: Any,
) -> Callable[[AnyCallable], HTTPRouteHandler]:
"""Create an :class:`HTTPRouteHandler` with a ``PATCH`` method.
Expand Down Expand Up @@ -786,7 +786,7 @@ def post(
type_decoders: TypeDecodersSequence | None = None,
type_encoders: TypeEncodersMap | None = None,
handler_class: type[HTTPRouteHandler] = HTTPRouteHandler,
handler_class: type[HTTPRouteHandler] = HTTPRouteHandler,**kwargs: Any,
**kwargs: Any,
) -> Callable[[AnyCallable], HTTPRouteHandler]:
"""Create an :class:`HTTPRouteHandler` with a ``POST`` method.
Expand Down Expand Up @@ -958,7 +958,7 @@ def put(
type_decoders: TypeDecodersSequence | None = None,
type_encoders: TypeEncodersMap | None = None,
handler_class: type[HTTPRouteHandler] = HTTPRouteHandler,
handler_class: type[HTTPRouteHandler] = HTTPRouteHandler,**kwargs: Any,
**kwargs: Any,
) -> Callable[[AnyCallable], HTTPRouteHandler]:
"""Create an :class:`HTTPRouteHandler` with a ``PUT`` method.
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_response/test_response_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_method(self) -> None:
route_handlers=[first_router, second_router],
)
route_handler = app.routes[0].route_handler_map["GET"] # type: ignore[union-attr]
response_cookies = {cookie.key: cookie.value for cookie in route_handler.resolve_response_cookies()}
response_cookies = {cookie.key: cookie.value for cookie in route_handler.response_cookies}
assert response_cookies["first"] == local_first.value
assert response_cookies["second"] == controller_second.value
assert response_cookies["third"] == router_second.value
Expand All @@ -55,7 +55,7 @@ def handler_one() -> None:
def handler_two() -> None:
pass

assert handler_one.resolve_response_cookies() == handler_two.resolve_response_cookies()
assert handler_one.resolve_response_cookies() == handler_two.response_cookies


def test_response_cookie_rendering() -> None:
Expand Down

0 comments on commit c2fc97d

Please sign in to comment.