litestar-vite 0.2.6__py3-none-any.whl → 0.2.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of litestar-vite might be problematic. Click here for more details.

@@ -6,6 +6,7 @@ from litestar.connection import Request
6
6
  from litestar.connection.base import AuthT, StateT, UserT
7
7
  from litestar.exceptions import (
8
8
  HTTPException,
9
+ ImproperlyConfiguredException,
9
10
  InternalServerException,
10
11
  NotAuthorizedException,
11
12
  NotFoundException,
@@ -72,7 +73,7 @@ def create_inertia_exception_response(request: Request[UserT, AuthT, StateT], ex
72
73
  content.update({"extra": extras})
73
74
  try:
74
75
  flash(request, detail, category="error")
75
- except AttributeError:
76
+ except (AttributeError, ImproperlyConfiguredException):
76
77
  msg = "Unable to set `flash` session state. A valid session was not found for this request."
77
78
  request.logger.warning(msg)
78
79
  if extras and len(extras) >= 1:
@@ -82,11 +83,8 @@ def create_inertia_exception_response(request: Request[UserT, AuthT, StateT], ex
82
83
  match = FIELD_ERR_RE.search(error_detail)
83
84
  field = match.group(1) if match else default_field
84
85
  if isinstance(message, dict):
85
- error(request, field, error_detail)
86
- if status_code in {HTTP_422_UNPROCESSABLE_ENTITY, HTTP_400_BAD_REQUEST} or isinstance(
87
- exc,
88
- PermissionDeniedException,
89
- ):
86
+ error(request, field, error_detail if error_detail else detail)
87
+ if status_code in {HTTP_422_UNPROCESSABLE_ENTITY, HTTP_400_BAD_REQUEST}:
90
88
  return InertiaBack(request)
91
89
  if isinstance(exc, PermissionDeniedException):
92
90
  return InertiaBack(request)
@@ -48,7 +48,7 @@ def share(
48
48
  ) -> None:
49
49
  try:
50
50
  connection.session.setdefault("_shared", {}).update({key: value})
51
- except AttributeError:
51
+ except (AttributeError, ImproperlyConfiguredException):
52
52
  msg = "Unable to set `share` session state. A valid session was not found for this request."
53
53
  connection.logger.warning(msg)
54
54
 
@@ -60,7 +60,7 @@ def error(
60
60
  ) -> None:
61
61
  try:
62
62
  connection.session.setdefault("_errors", {}).update({key: message})
63
- except AttributeError:
63
+ except (AttributeError, ImproperlyConfiguredException):
64
64
  msg = "Unable to set `error` session state. A valid session was not found for this request."
65
65
  connection.logger.warning(msg)
66
66
 
@@ -87,7 +87,7 @@ def get_shared_props(request: ASGIConnection[Any, Any, Any, Any]) -> Dict[str, A
87
87
  if session_prop not in props and session_prop in request.session:
88
88
  props[session_prop] = request.session.get(session_prop)
89
89
 
90
- except AttributeError:
90
+ except (AttributeError, ImproperlyConfiguredException):
91
91
  msg = "Unable to generate all shared props. A valid session was not found for this request."
92
92
  request.logger.warning(msg)
93
93
  props["flash"] = flash
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: litestar-vite
3
- Version: 0.2.6
3
+ Version: 0.2.7
4
4
  Summary: Vite plugin for Litestar
5
5
  Project-URL: Changelog, https://cofin.github.io/litestar-vite/latest/changelog
6
6
  Project-URL: Discord, https://discord.gg/X3FJqy8d2j
@@ -10,11 +10,11 @@ litestar_vite/template_engine.py,sha256=ffC4KPtUUNkuC0tJ0bD1Bu7c8lE33vKP0US1fWUY
10
10
  litestar_vite/inertia/__init__.py,sha256=RLeCWGHsHyBPpUjSXRhYOQlTh9cG33Q115zGH89M6XE,863
11
11
  litestar_vite/inertia/_utils.py,sha256=ijO9Lgka7ZPIAHkby9szbTGoSg0nDShC2bqWT9cDxi0,1956
12
12
  litestar_vite/inertia/config.py,sha256=ziEO-xQ5SoE7niri39PMXYgieM94Yf0y4BCFyaMs6P0,1125
13
- litestar_vite/inertia/exception_handler.py,sha256=HrFa8in0wF9V5PuctG3flIrhhEPsWUuocEW56_hfFAc,4747
13
+ litestar_vite/inertia/exception_handler.py,sha256=S-55sCQ6zLSMICo8l9co0RbT5Dr_TzJlRQBg7YpsRXM,4774
14
14
  litestar_vite/inertia/middleware.py,sha256=NEDcAoT7GMWA9hEGvANZ3MG5_p3MmZX57RF95T71les,1716
15
15
  litestar_vite/inertia/plugin.py,sha256=ebAG9XnDBahttuc7WIUgBd3o_Ys8MdPS273LPNs5H8A,2344
16
16
  litestar_vite/inertia/request.py,sha256=hk8m1pmDiMbWhVurRDHfDPD24nMHp56JzUKV6SBDeqA,3665
17
- litestar_vite/inertia/response.py,sha256=XJuyxTSiFvjZLbs42Lh9sZw8IhZIezJf3cwC8p2NJcw,15886
17
+ litestar_vite/inertia/response.py,sha256=XcAXmQ6Ex_XZVc5UF9ULxzOgJ2EKlivJKKVm_EPAebw,15985
18
18
  litestar_vite/inertia/routes.py,sha256=QksJm2RUfL-WbuhOieYnPXXWO5GYnPtmsYEm6Ef8Yeo,1782
19
19
  litestar_vite/inertia/types.py,sha256=tLp0pm1N__hcWC875khf6wH1nuFlKS9-VjDqgsRkXnw,702
20
20
  litestar_vite/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -24,7 +24,7 @@ litestar_vite/templates/package.json.j2,sha256=0JWgdTuaSZ25EmCltF_zbqDdpxfvCLeYu
24
24
  litestar_vite/templates/styles.css.j2,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  litestar_vite/templates/tsconfig.json.j2,sha256=q1REIuVyXUHCy4Zi2kgTkmrhdT98vyY89k-WTrImOj8,843
26
26
  litestar_vite/templates/vite.config.ts.j2,sha256=FZ4OJaB8Kjby_nlx4_LCP8eCe1LRi8kW2GspCiVMfDY,1115
27
- litestar_vite-0.2.6.dist-info/METADATA,sha256=XE7jCLWJ4l4nX8X0w_TNfCBdiFxQ75U_xPZinfxMp7M,6180
28
- litestar_vite-0.2.6.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
29
- litestar_vite-0.2.6.dist-info/licenses/LICENSE,sha256=HeTiEfEgvroUXZe_xAmYHxtTBgw--mbXyZLsWDYabHc,1069
30
- litestar_vite-0.2.6.dist-info/RECORD,,
27
+ litestar_vite-0.2.7.dist-info/METADATA,sha256=tMy61p67HGfR89sAeQECdLdltWx1B767mzjw_emFujU,6180
28
+ litestar_vite-0.2.7.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
29
+ litestar_vite-0.2.7.dist-info/licenses/LICENSE,sha256=HeTiEfEgvroUXZe_xAmYHxtTBgw--mbXyZLsWDYabHc,1069
30
+ litestar_vite-0.2.7.dist-info/RECORD,,