From 8a57093309d27a468c1d694528c868800b9d9ee6 Mon Sep 17 00:00:00 2001 From: Victor Shnayder Date: Fri, 21 Sep 2012 15:05:50 -0400 Subject: [PATCH 1/2] Make static tab url pattern less greedy * should fix links without trailing slash --- lms/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/urls.py b/lms/urls.py index a989767d76..d0e58a0622 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -204,7 +204,7 @@ if settings.COURSEWARE_ENABLED: ) urlpatterns += ( # This MUST be the last view in the courseware--it's a catch-all for custom tabs. - url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/(?P.*)$', + url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/(?P[^/]+)$', 'courseware.views.static_tab', name="static_tab"), ) From cc13b61e3017daf6f49bc7deed3779160161a20f Mon Sep 17 00:00:00 2001 From: Victor Shnayder Date: Fri, 21 Sep 2012 15:12:23 -0400 Subject: [PATCH 2/2] add a trailing slash to avoid conflicts with slash-appending redirects --- lms/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/urls.py b/lms/urls.py index d0e58a0622..1d738609e6 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -204,7 +204,7 @@ if settings.COURSEWARE_ENABLED: ) urlpatterns += ( # This MUST be the last view in the courseware--it's a catch-all for custom tabs. - url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/(?P[^/]+)$', + url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/(?P[^/]+)/$', 'courseware.views.static_tab', name="static_tab"), )