← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~allenap/launchpad/wrong-needs-linking-count-bug-795359 into lp:launchpad

 

Gavin Panella has proposed merging lp:~allenap/launchpad/wrong-needs-linking-count-bug-795359 into lp:launchpad with lp:~allenap/launchpad/requested-sync-grammar-bug-826752 as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #795359 in Launchpad itself: "Derived distro series page shows wrong count of needs linking packages"
  https://bugs.launchpad.net/launchpad/+bug/795359

For more details, see:
https://code.launchpad.net/~allenap/launchpad/wrong-needs-linking-count-bug-795359/+merge/71715

The bug notes that the count in +needs-packaging is correct, so this
branch simply uses the same mechanism as +needs-packaging to get the
count.

This is a very simple branch, but I'm not going to self review. The
solution was so easy that I wonder if I've missed something. I want
someone else to approve this and thus join me as a companion in my
inevitable fall.

-- 
https://code.launchpad.net/~allenap/launchpad/wrong-needs-linking-count-bug-795359/+merge/71715
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/launchpad/wrong-needs-linking-count-bug-795359 into lp:launchpad.
=== modified file 'lib/lp/registry/browser/distroseries.py'
--- lib/lp/registry/browser/distroseries.py	2011-08-10 17:00:16 +0000
+++ lib/lp/registry/browser/distroseries.py	2011-08-16 15:30:22 +0000
@@ -443,7 +443,7 @@
     @property
     def num_unlinked_packages(self):
         """The number of unlinked packagings for this distroseries."""
-        return self.context.sourcecount - self.num_linked_packages
+        return self.context.getPrioritizedUnlinkedSourcePackages().count()
 
     @cachedproperty
     def recently_linked(self):

=== modified file 'lib/lp/registry/stories/distroseries/xx-distroseries-index.txt'
--- lib/lp/registry/stories/distroseries/xx-distroseries-index.txt	2011-08-11 06:33:04 +0000
+++ lib/lp/registry/stories/distroseries/xx-distroseries-index.txt	2011-08-16 15:30:22 +0000
@@ -141,7 +141,7 @@
     ...     find_tag_by_id(anon_browser.contents, 'series-packaging'))
     Upstream packaging
     5 source packages are linked to registered upstream projects.
-    -2 need linking.
+    3 need linking.
     Recently linked to upstream:
     alsa-utils linked...
     a52dec linked...