From 03f6a63c6c6dff900b559b35ab571133990613a2 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 26 Feb 2015 20:44:25 -0600 Subject: Fix URL precedence due to /json/ and mirror name overlap Move these back into one block and just use function references rather than the string-based way. Signed-off-by: Dan McGee --- mirrors/urls.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'mirrors/urls.py') diff --git a/mirrors/urls.py b/mirrors/urls.py index a41bfdc3..fc510fbb 100644 --- a/mirrors/urls.py +++ b/mirrors/urls.py @@ -1,18 +1,18 @@ from django.conf.urls import patterns -urlpatterns = patterns('mirrors.views', - (r'^$', 'mirrors', {}, 'mirror-list'), - (r'^status/$', 'status', {}, 'mirror-status'), - (r'^status/tier/(?P\d+)/$', 'status', {}, 'mirror-status-tier'), - (r'^(?P[\.\-\w]+)/$', 'mirror_details'), - (r'^(?P[\.\-\w]+)/(?P\d+)/$', 'url_details'), -) +from .views import mirrors, status, mirror_details, url_details +from .views.api import status_json, mirror_details_json, locations_json -urlpatterns += patterns('mirrors.views.api', - (r'^status/json/$', 'status_json', {}, 'mirror-status-json'), - (r'^status/tier/(?P\d+)/json/$', 'status_json', {}, 'mirror-status-tier-json'), - (r'^locations/json/$', 'locations_json', {}, 'mirror-locations-json'), - (r'^(?P[\.\-\w]+)/json/$', 'mirror_details_json'), +urlpatterns = patterns('', + (r'^$', mirrors, {}, 'mirror-list'), + (r'^status/$', status, {}, 'mirror-status'), + (r'^status/json/$', status_json, {}, 'mirror-status-json'), + (r'^status/tier/(?P\d+)/$', status, {}, 'mirror-status-tier'), + (r'^status/tier/(?P\d+)/json/$', status_json, {}, 'mirror-status-tier-json'), + (r'^locations/json/$', locations_json, {}, 'mirror-locations-json'), + (r'^(?P[\.\-\w]+)/$', mirror_details), + (r'^(?P[\.\-\w]+)/json/$', mirror_details_json), + (r'^(?P[\.\-\w]+)/(?P\d+)/$', url_details), ) # vim: set ts=4 sw=4 et: -- cgit v1.2.3-2-g168b