From: Stephen Finucane Date: Tue, 21 Feb 2017 19:39:07 +0000 (-0500) Subject: views: Stop using Bundle.public_url X-Git-Tag: v2.0.0-rc1~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1c605f;p=thirdparty%2Fpatchwork.git 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 --- 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 }} -