From a4eeab1835863fb676f99a5c64c41d1e6248b2ae Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Wed, 22 Nov 2023 13:58:20 +1100 Subject: [PATCH] fossy: check UUID format in the URL routing to avoid unhandled exception Requests like /fossy/xyz123/ were causing an error due to "xyz123" not being a valid UUID. We should just return a 404 in this case, which the URL routing will now do automatically. --- conservancy/fossy/urls.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conservancy/fossy/urls.py b/conservancy/fossy/urls.py index fbbabd19..c567e81c 100644 --- a/conservancy/fossy/urls.py +++ b/conservancy/fossy/urls.py @@ -1,8 +1,8 @@ -from django.conf.urls import url +from django.urls import path from .views import CommunityTrackProposalCreateView, CommunityTrackProposalThanksView urlpatterns = [ - url(r'^community-tracks/$', CommunityTrackProposalCreateView.as_view(), name='fossy-add'), - url(r'^(?P[\w-]+)/$', CommunityTrackProposalThanksView.as_view(), name='fossy-thanks'), + path('community-tracks/', CommunityTrackProposalCreateView.as_view(), name='fossy-add'), + path('/', CommunityTrackProposalThanksView.as_view(), name='fossy-thanks'), ]