summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/urls.py
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-04-20 21:45:40 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-04-20 22:45:20 +0800
commit5d0140ef04ababd93c45b5126ee1b412bd778da5 (patch)
treeef1c8adf417e7c1d4e556d50877dfaf4e1f263aa /apps/patchwork/urls.py
parent627f5aca263da2513fe6d592becd3b505d97dd21 (diff)
downloadpatchwork-5d0140ef04ababd93c45b5126ee1b412bd778da5.tar.bz2
patchwork-5d0140ef04ababd93c45b5126ee1b412bd778da5.tar.xz
bundles: Remove separate public bundle views
Having two views for bundles (public and non-public) can cause confusion when bundle owners want to share a URL; it's not obvious that the private URL isn't shareable. This change removes the private URLs, and puts all bundles under the /bundle/<username>/<bundlename>/ URL space. For non-public bundles, this will just 404 for non-owners. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/urls.py')
-rw-r--r--apps/patchwork/urls.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/patchwork/urls.py b/apps/patchwork/urls.py
index 3209830..a44f17c 100644
--- a/apps/patchwork/urls.py
+++ b/apps/patchwork/urls.py
@@ -39,10 +39,6 @@ urlpatterns = patterns('',
(r'^user/bundles/$',
'patchwork.views.bundle.bundles'),
- (r'^user/bundle/(?P<bundle_id>[^/]+)/$',
- 'patchwork.views.bundle.bundle'),
- (r'^user/bundle/(?P<bundle_id>[^/]+)/mbox/$',
- 'patchwork.views.bundle.mbox'),
(r'^user/link/$', 'patchwork.views.user.link'),
(r'^user/unlink/(?P<person_id>[^/]+)/$', 'patchwork.views.user.unlink'),
@@ -66,9 +62,9 @@ urlpatterns = patterns('',
# public view for bundles
(r'^bundle/(?P<username>[^/]*)/(?P<bundlename>[^/]*)/$',
- 'patchwork.views.bundle.public'),
+ 'patchwork.views.bundle.bundle'),
(r'^bundle/(?P<username>[^/]*)/(?P<bundlename>[^/]*)/mbox/$',
- 'patchwork.views.bundle.public_mbox'),
+ 'patchwork.views.bundle.mbox'),
(r'^confirm/(?P<key>[0-9a-f]+)/$', 'patchwork.views.confirm'),
@@ -91,3 +87,13 @@ if settings.ENABLE_XMLRPC:
(r'^project/(?P<project_id>[^/]+)/pwclientrc/$',
'patchwork.views.pwclientrc'),
)
+
+# redirect from old urls
+if settings.COMPAT_REDIR:
+ urlpatterns += patterns('',
+ (r'^user/bundle/(?P<bundle_id>[^/]+)/$',
+ 'patchwork.views.bundle.bundle_redir'),
+ (r'^user/bundle/(?P<bundle_id>[^/]+)/mbox/$',
+ 'patchwork.views.bundle.mbox_redir'),
+ )
+