summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2015-02-26 20:44:25 -0600
committerDan McGee <dan@archlinux.org>2015-02-26 20:44:25 -0600
commit03f6a63c6c6dff900b559b35ab571133990613a2 (patch)
treeaec58acd298f8658808c997f9ed15e45526c19aa
parent65daa766cad72f9d6271439789fc399999b3a973 (diff)
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 <dan@archlinux.org>
-rw-r--r--mirrors/urls.py24
1 files changed, 12 insertions, 12 deletions
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<tier>\d+)/$', 'status', {}, 'mirror-status-tier'),
- (r'^(?P<name>[\.\-\w]+)/$', 'mirror_details'),
- (r'^(?P<name>[\.\-\w]+)/(?P<url_id>\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<tier>\d+)/json/$', 'status_json', {}, 'mirror-status-tier-json'),
- (r'^locations/json/$', 'locations_json', {}, 'mirror-locations-json'),
- (r'^(?P<name>[\.\-\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<tier>\d+)/$', status, {}, 'mirror-status-tier'),
+ (r'^status/tier/(?P<tier>\d+)/json/$', status_json, {}, 'mirror-status-tier-json'),
+ (r'^locations/json/$', locations_json, {}, 'mirror-locations-json'),
+ (r'^(?P<name>[\.\-\w]+)/$', mirror_details),
+ (r'^(?P<name>[\.\-\w]+)/json/$', mirror_details_json),
+ (r'^(?P<name>[\.\-\w]+)/(?P<url_id>\d+)/$', url_details),
)
# vim: set ts=4 sw=4 et: