summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/models.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/models.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/models.py')
-rw-r--r--apps/patchwork/models.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py
index 86a5266..9129aab 100644
--- a/apps/patchwork/models.py
+++ b/apps/patchwork/models.py
@@ -363,12 +363,19 @@ class Bundle(models.Model):
return None
site = Site.objects.get_current()
return 'http://%s%s' % (site.domain,
- reverse('patchwork.views.bundle.public',
+ reverse('patchwork.views.bundle.bundle',
kwargs = {
'username': self.owner.username,
'bundlename': self.name
}))
+ @models.permalink
+ def get_absolute_url(self):
+ return ('patchwork.views.bundle.bundle', (), {
+ 'username': self.owner.username,
+ 'bundlename': self.name,
+ })
+
def mbox(self):
return '\n'.join([p.mbox().as_string(True)
for p in self.ordered_patches()])