From a401c586ea821ae295e72f00a436ed5e957d20fe Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 20 Oct 2016 08:28:54 +0100 Subject: [PATCH] models: Remove Bundle.n_patches It doesn't really do much for us. Less LOC = win. Signed-off-by: Stephen Finucane Reviewed-by: Daniel Axtens --- patchwork/models.py | 3 --- patchwork/templates/patchwork/bundles.html | 2 +- patchwork/views/xmlrpc.py | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/patchwork/models.py b/patchwork/models.py index 6f3257f9..51f97450 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -570,9 +570,6 @@ class Bundle(models.Model): patches = models.ManyToManyField(Patch, through='BundlePatch') public = models.BooleanField(default=False) - def n_patches(self): - return self.patches.all().count() - def ordered_patches(self): return self.patches.order_by('bundlepatch__order') diff --git a/patchwork/templates/patchwork/bundles.html b/patchwork/templates/patchwork/bundles.html index 2eebd262..45bdec51 100644 --- a/patchwork/templates/patchwork/bundles.html +++ b/patchwork/templates/patchwork/bundles.html @@ -27,7 +27,7 @@ {{ bundle.public_url }} {% endif %} - {{ bundle.n_patches }} + {{ bundle.patches.count }}