dmart 1.4.41.post40__py3-none-any.whl → 1.4.41.post42__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.
dmart/main.py CHANGED
@@ -87,7 +87,7 @@ class SPAStaticFiles(StaticFiles):
87
87
 
88
88
  content = content.replace("/cxb/", target_url)
89
89
 
90
- cxb_name = settings.cxb_url.strip("/")
90
+ cxb_name = settings.cxb_url.rstrip("/")
91
91
  if cxb_name != "cxb":
92
92
  content = content.replace('"cxb"', f'"{cxb_name}"')
93
93
 
@@ -561,7 +561,10 @@ if os.path.isdir(cxb_path):
561
561
  "cxb_url": settings.cxb_url
562
562
  }
563
563
 
564
- app.mount(settings.cxb_url, SPAStaticFiles(directory=cxb_path, html=True), name="cxb")
564
+ mount_path = settings.cxb_url
565
+ if not mount_path.endswith("/"):
566
+ mount_path += "/"
567
+ app.mount(mount_path, SPAStaticFiles(directory=cxb_path, html=True), name="cxb")
565
568
 
566
569
  @app.options("/{x:path}", include_in_schema=False)
567
570
  async def myoptions():
@@ -574,8 +577,8 @@ async def myoptions():
574
577
  @app.patch("/{x:path}", include_in_schema=False)
575
578
  @app.delete("/{x:path}", include_in_schema=False)
576
579
  async def catchall(x):
577
- if x.startswith(settings.cxb_url.strip("/")):
578
- return RedirectResponse(f"{settings.cxb_url}/")
580
+ if x == settings.cxb_url.strip("/"):
581
+ return RedirectResponse(f"{settings.cxb_url.rstrip('/')}/")
579
582
  raise api.Exception(
580
583
  status_code=status.HTTP_404_NOT_FOUND,
581
584
  error=api.Error(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmart
3
- Version: 1.4.41.post40
3
+ Version: 1.4.41.post42
4
4
  Requires-Python: >=3.11
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: pydantic
@@ -14,7 +14,7 @@ dmart/hypercorn_config.toml,sha256=-eryppEG8HBOM_KbFc4dTQePnpyfoW9ZG5aUATU_6yM,5
14
14
  dmart/info.json,sha256=1VYb3TIoWeUp8-9IPkNkfqHIb3znxlrd8qa7oBl3_No,123
15
15
  dmart/login_creds.sh,sha256=Aht1LwL11uzR13sa8p3BdeUCprIa9tq0vzOoplJjH5U,235
16
16
  dmart/login_creds.sh.sample,sha256=Sb43HNNn1g11rrJrtDsPgAxcXu3_wJvdNn--8S62dTE,227
17
- dmart/main.py,sha256=nvpxQ8Ht0FCl5opAxDVGpYD7atmfSD-NopeefQKrtrs,21407
17
+ dmart/main.py,sha256=z7r4NtEyYvT0lgATczEKYD4MnNmFevZkU_UjPCMG53M,21502
18
18
  dmart/manifest.sh,sha256=K3mY5MsUlrTyHa5cARslkShegvXh-UeqJcE2UZobdrE,544
19
19
  dmart/migrate.py,sha256=hn1MZoVby_Jjqhc7y3CrLcGD619QmVZv3PONNvO7VKQ,665
20
20
  dmart/password_gen.py,sha256=xjx8wi105ZYvhLBBQj7_rugACpxifGXHse6f7YlGXWQ,196
@@ -483,8 +483,8 @@ dmart/utils/ticket_sys_utils.py,sha256=9QAlW2iiy8KyxQRBDj_WmzS5kKb0aYJmGwd4qzmGV
483
483
  dmart/utils/web_notifier.py,sha256=QM87VVid2grC5lK3NdS1yzz0z1wXljr4GChJOeK86W4,843
484
484
  dmart/utils/templates/activation.html.j2,sha256=XAMKCdoqONoc4ZQucD0yV-Pg5DlHHASZrTVItNS-iBE,640
485
485
  dmart/utils/templates/reminder.html.j2,sha256=aoS8bTs56q4hjAZKsb0jV9c-PIURBELuBOpT_qPZNVU,639
486
- dmart-1.4.41.post40.dist-info/METADATA,sha256=T9xz1aJ8xlA7TifKPgdR6EaI932upeYneh56zGY00sQ,839
487
- dmart-1.4.41.post40.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
488
- dmart-1.4.41.post40.dist-info/entry_points.txt,sha256=N832M4wG8d2GDw1xztKRVM3TnxpY2QDzvdFE8XaWaG8,43
489
- dmart-1.4.41.post40.dist-info/top_level.txt,sha256=zJo4qk9fUW0BGIR9f4DCfpxaXbvQXH9izIOom6JsyAo,6
490
- dmart-1.4.41.post40.dist-info/RECORD,,
486
+ dmart-1.4.41.post42.dist-info/METADATA,sha256=rbhBIqaj-31REIZxH9Ak_-ErdfrnBDdc19C9Jvwy5zk,839
487
+ dmart-1.4.41.post42.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
488
+ dmart-1.4.41.post42.dist-info/entry_points.txt,sha256=N832M4wG8d2GDw1xztKRVM3TnxpY2QDzvdFE8XaWaG8,43
489
+ dmart-1.4.41.post42.dist-info/top_level.txt,sha256=zJo4qk9fUW0BGIR9f4DCfpxaXbvQXH9izIOom6JsyAo,6
490
+ dmart-1.4.41.post42.dist-info/RECORD,,