mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
[PUI] URL fixes (#5989)
* added helper to render an instance for an url * removed unneeded declaration * restructed PUI urls to improve behaviour: - removes dead routes - adds percausion to make sure asset-matching path is always the same - makes sure subpaths of the PUI path also match to PUI (fixing a current bug with fully reload PUI) * clean up diff
This commit is contained in:
parent
87df9245eb
commit
fac66b289b
@ -217,9 +217,6 @@ classic_frontendpatterns = [
|
|||||||
re_path(r'^accounts/', include('allauth.urls')), # included urlpatterns
|
re_path(r'^accounts/', include('allauth.urls')), # included urlpatterns
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
new_frontendpatterns = platform_urls
|
|
||||||
|
|
||||||
urlpatterns = []
|
urlpatterns = []
|
||||||
|
|
||||||
if settings.INVENTREE_ADMIN_ENABLED:
|
if settings.INVENTREE_ADMIN_ENABLED:
|
||||||
@ -236,7 +233,7 @@ frontendpatterns = []
|
|||||||
if settings.ENABLE_CLASSIC_FRONTEND:
|
if settings.ENABLE_CLASSIC_FRONTEND:
|
||||||
frontendpatterns += classic_frontendpatterns
|
frontendpatterns += classic_frontendpatterns
|
||||||
if settings.ENABLE_PLATFORM_FRONTEND:
|
if settings.ENABLE_PLATFORM_FRONTEND:
|
||||||
frontendpatterns += new_frontendpatterns
|
frontendpatterns += platform_urls
|
||||||
|
|
||||||
urlpatterns += frontendpatterns
|
urlpatterns += frontendpatterns
|
||||||
|
|
||||||
|
@ -17,15 +17,15 @@ class RedirectAssetView(TemplateView):
|
|||||||
|
|
||||||
|
|
||||||
spa_view = ensure_csrf_cookie(TemplateView.as_view(template_name="web/index.html"))
|
spa_view = ensure_csrf_cookie(TemplateView.as_view(template_name="web/index.html"))
|
||||||
|
assets_path = path("assets/<path:path>", RedirectAssetView.as_view())
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path(f'{settings.FRONTEND_URL_BASE}/', include([
|
path(f"{settings.FRONTEND_URL_BASE}/", include([
|
||||||
path("assets/<path:path>", RedirectAssetView.as_view()),
|
assets_path,
|
||||||
re_path(r"^(?P<path>.*)/$", spa_view),
|
path("set-password?uid=<uid>&token=<token>", spa_view, name="password_reset_confirm",),
|
||||||
path("set-password?uid=<uid>&token=<token>", spa_view, name="password_reset_confirm"),
|
re_path(".*", spa_view),
|
||||||
path("", spa_view),]
|
])),
|
||||||
)),
|
assets_path,
|
||||||
path(settings.FRONTEND_URL_BASE, spa_view, name='platform'),
|
path(settings.FRONTEND_URL_BASE, spa_view, name="platform"),
|
||||||
path("assets/<path:path>", RedirectAssetView.as_view()),
|
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user