fix(urls): move static-prefix routes before dynamic <str:uid>/ pattern
Relocate `search/`, `concepts/`, and `concepts/<str:uid>/` URL patterns to appear before the `<str:uid>/` catch-all route, preventing Django from incorrectly matching those static prefixes as library UIDs.
This commit is contained in:
@@ -17,6 +17,12 @@ urlpatterns = [
|
||||
# Library CRUD
|
||||
path("", views.library_list, name="library-list"),
|
||||
path("create/", views.library_create, name="library-create"),
|
||||
# Static-prefix routes must come before <str:uid>/ or it will swallow them.
|
||||
# Search (Phase 3)
|
||||
path("search/", views.search_page, name="search"),
|
||||
# Concepts (Phase 3)
|
||||
path("concepts/", views.concept_list_page, name="concept-list"),
|
||||
path("concepts/<str:uid>/", views.concept_detail_page, name="concept-detail"),
|
||||
path("<str:uid>/", views.library_detail, name="library-detail"),
|
||||
path("<str:uid>/search/", views.library_search, name="library-search"),
|
||||
path("<str:uid>/edit/", views.library_edit, name="library-edit"),
|
||||
@@ -55,11 +61,6 @@ urlpatterns = [
|
||||
path("items/<str:uid>/delete/", views.item_delete, name="item-delete"),
|
||||
# Image views
|
||||
path("images/<str:uid>/view/", views.image_serve, name="image-serve"),
|
||||
# Search (Phase 3)
|
||||
path("search/", views.search_page, name="search"),
|
||||
# Concepts (Phase 3)
|
||||
path("concepts/", views.concept_list_page, name="concept-list"),
|
||||
path("concepts/<str:uid>/", views.concept_detail_page, name="concept-detail"),
|
||||
# DRF API
|
||||
path("api/", include("library.api.urls")),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user