dmart 1.4.2__py3-none-any.whl → 1.4.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmart
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
  Requires-Python: >=3.11
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: pydantic
@@ -2,7 +2,7 @@ bundler.py,sha256=so8ZJResb1PcOH5vboa_mpFAdYr_T8u8DbbFXd570Lg,1704
2
2
  data_generator.py,sha256=CnE-VHEeX7-lAXtqCgbRqR9WHjTuOgeiZcviYrHAmho,2287
3
3
  dmart.py,sha256=WugBannLMtYISbGPfK5Lak-2BPm14cFHNyJwkD-26RM,21711
4
4
  get_settings.py,sha256=Sbe2WCoiK398E7HY4SNLfDN_GmE8knR4M-YJWF31jcg,153
5
- main.py,sha256=3UqzJUoiaZmcoL4yFInka5DMfh_-Agl-gHRCHELL2UM,19551
5
+ main.py,sha256=LZYT5wKNECd0xWA0mAZBunoW1y_RtaaUdQOO7xoZcJU,20098
6
6
  migrate.py,sha256=hn1MZoVby_Jjqhc7y3CrLcGD619QmVZv3PONNvO7VKQ,665
7
7
  password_gen.py,sha256=xjx8wi105ZYvhLBBQj7_rugACpxifGXHse6f7YlGXWQ,196
8
8
  run_notification_campaign.py,sha256=ZCvHfaimK4W6q4XuHs2r6wavMGipYYw4aUkNlxmGUd8,2652
@@ -142,8 +142,8 @@ utils/ticket_sys_utils.py,sha256=9QAlW2iiy8KyxQRBDj_WmzS5kKb0aYJmGwd4qzmGVqo,700
142
142
  utils/web_notifier.py,sha256=QM87VVid2grC5lK3NdS1yzz0z1wXljr4GChJOeK86W4,843
143
143
  utils/templates/activation.html.j2,sha256=XAMKCdoqONoc4ZQucD0yV-Pg5DlHHASZrTVItNS-iBE,640
144
144
  utils/templates/reminder.html.j2,sha256=aoS8bTs56q4hjAZKsb0jV9c-PIURBELuBOpT_qPZNVU,639
145
- dmart-1.4.2.dist-info/METADATA,sha256=Kyjoer4hkgh3VhudnHtnbyuJO5ZJzjfheq2QihC6sPI,2068
146
- dmart-1.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
147
- dmart-1.4.2.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
148
- dmart-1.4.2.dist-info/top_level.txt,sha256=JTypu1r5v9v7ru-60JSSbnSMEESHFRMacpcz-rPJx_U,262
149
- dmart-1.4.2.dist-info/RECORD,,
145
+ dmart-1.4.3.dist-info/METADATA,sha256=M7EkARIc0iYV5zNXpVCLGk1xYLFnOL0hQqAownZ5cdA,2068
146
+ dmart-1.4.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
147
+ dmart-1.4.3.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
148
+ dmart-1.4.3.dist-info/top_level.txt,sha256=JTypu1r5v9v7ru-60JSSbnSMEESHFRMacpcz-rPJx_U,262
149
+ dmart-1.4.3.dist-info/RECORD,,
main.py CHANGED
@@ -31,6 +31,19 @@ from hypercorn.config import Config
31
31
  from starlette.concurrency import iterate_in_threadpool
32
32
  from starlette.exceptions import HTTPException as StarletteHTTPException
33
33
  from starlette.staticfiles import StaticFiles
34
+ from starlette.responses import Response
35
+
36
+ class SPAStaticFiles(StaticFiles):
37
+ async def get_response(self, path: str, scope) -> Response:
38
+ try:
39
+ return await super().get_response(path, scope)
40
+ except StarletteHTTPException as ex:
41
+ if ex.status_code == 404 and path != "index.html" and not os.path.splitext(path)[1]:
42
+ try:
43
+ return await super().get_response("index.html", scope)
44
+ except StarletteHTTPException:
45
+ pass
46
+ raise ex
34
47
  import models.api as api
35
48
  from utils.settings import settings
36
49
  from asgi_correlation_id import CorrelationIdMiddleware
@@ -508,7 +521,7 @@ if os.path.isdir(cxb_path):
508
521
  "websocket": settings.websocket_url if settings.websocket_url else f"ws://{settings.listening_host}:{settings.websocket_port}/ws"
509
522
  }
510
523
 
511
- app.mount(settings.cxb_url, StaticFiles(directory=cxb_path, html=True), name="cxb")
524
+ app.mount(settings.cxb_url, SPAStaticFiles(directory=cxb_path, html=True), name="cxb")
512
525
 
513
526
  @app.options("/{x:path}", include_in_schema=False)
514
527
  async def myoptions():
File without changes