From d1c605f9cb11f8c0f76a91217b73382ebf590d93 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 21 Feb 2017 14:39:07 -0500 Subject: [PATCH] views: Stop using Bundle.public_url We now have 'get_mbox_url' which is consistent with patches. Let's drop the older one. Signed-off-by: Stephen Finucane Reviewed-by: Andy Doan --- patchwork/models.py | 13 ------------- patchwork/templates/patchwork/bundles.html | 5 ++--- patchwork/views/xmlrpc.py | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/patchwork/models.py b/patchwork/models.py index 199c1182..ee929e3b 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -29,8 +29,6 @@ import re import django from django.conf import settings from django.contrib.auth.models import User -from django.contrib.sites.models import Site -from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.functional import cached_property @@ -723,17 +721,6 @@ class Bundle(models.Model): return BundlePatch.objects.create(bundle=self, patch=patch, order=max_order + 1) - def public_url(self): - if not self.public: - return None - site = Site.objects.get_current() - return 'http://%s%s' % (site.domain, - reverse('bundle-detail', - kwargs={ - 'username': self.owner.username, - 'bundlename': self.name - })) - @models.permalink def get_absolute_url(self): return ('bundle-detail', (), { diff --git a/patchwork/templates/patchwork/bundles.html b/patchwork/templates/patchwork/bundles.html index 83e1bd0e..9e225ea0 100644 --- a/patchwork/templates/patchwork/bundles.html +++ b/patchwork/templates/patchwork/bundles.html @@ -24,12 +24,11 @@ {{ bundle.project.linkname }} {% if bundle.public %} - {{ bundle.public_url }} + {{ bundle.get_mbox_url }} {% endif %} {{ bundle.patches.count }} -