ixg_platform/apps/buyer/urls.py
ixgadmin cdefbd010c Serve document and certificate files through a permission-checked download
Media was unreachable from either portal, which is why the certificate button on
the buyer compliance page returned page-not-found and no document row had
anything to click. The cause was structural: the portal and ops hosts proxy
location / to the app with a path prefix, so a stored /media/... URL arrives as
/portal/media/... and matches no route.

Add a download view per portal behind the same role gate as the page that links
to it — buyer-visible documents and published certificates for buyers, anything
the ops list shows for operations — resolving the stored path safely under
MEDIA_ROOT so a traversal or an absolute path is refused. Point the seven
templates that list files at the new routes.

Also add a portal-wide render sweep: nothing in the suite was fetching the ops
or portal pages, so a view could lose its template_name and 500 in front of a
user with every test still green.
2026-09-17 12:44:52 +00:00

19 lines
1 KiB
Python

from django.urls import path
from . import views
app_name = 'portal'
urlpatterns = [
path("chat/", views.ChatView.as_view(), name="chat"),
path("chat/embed/", views.ChatEmbedView.as_view(), name="chat_embed"),
path('', views.DashboardView.as_view(), name='dashboard'),
path('batches/', views.BatchListView.as_view(), name='batch_list'),
path('batches/<uuid:pk>/', views.BatchDetailView.as_view(), name='batch_detail'),
path('documents/', views.DocumentListView.as_view(), name='document_list'),
path('documents/<uuid:pk>/download/', views.DocumentDownloadView.as_view(), name='document_download'),
path('certificates/<uuid:pk>/download/', views.CoADownloadView.as_view(), name='coa_download'),
path('subscription/', views.SubscriptionView.as_view(), name='subscription'),
path('compliance/', views.ComplianceView.as_view(), name='compliance'),
path('help/', views.GuideIndexView.as_view(), name='guide_index'),
path('help/<path:page_path>/', views.GuideDetailView.as_view(), name='guide_detail'),
]