Merge lp://staging/~edwin-grubbs/launchpad/bug-552619-suggesting-removed-packages into lp://staging/launchpad

Proposed by Edwin Grubbs
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://staging/~edwin-grubbs/launchpad/bug-552619-suggesting-removed-packages
Merge into: lp://staging/launchpad
Diff against target: 66 lines (+26/-10)
2 files modified
lib/lp/registry/browser/product.py (+9/-7)
lib/lp/registry/browser/tests/product-portlet-packages-view.txt (+17/-3)
To merge this branch: bzr merge lp://staging/~edwin-grubbs/launchpad/bug-552619-suggesting-removed-packages
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+22912@code.staging.launchpad.net

Commit message

Fix problem where the project index page would suggest linking to an ubuntu package that had been deleted.

Description of the change

Summary
-------

ubuntu.searchSourcePackages() was returning packages that are invalid
suggestions since it does not filter on the status of the entries in the
SourcePackagePublishingHistory table.

Implementation details
----------------------

Instead of extending the search functionality, I matched the assertion
in the model by checking the SourcePackage.currentrelease for
ubuntu.currentseries. ubuntu.searchSourcePackages() actually returns
DistributionSourcePackage objects. The SourcePackage objects for the
currentseries is accessed as the development_version attribute on the
DistributionSourcePackage.

Tests
-----

./bin/test -vv -t product-portlet-packages-view

Demo and Q/A
------------

On launchpad.dev:
* Run this query on the launchpad_dev db:
  UPDATE sourcepackagepublishinghistory SET distroseries = 22, status=3;
  * Open http://launchpad.dev/firefox
    * There should be no packages suggested in the Packages in Ubuntu
      portlet.

On edge:
* Open https://edge.launchpad.net/waf
  * The "waf" package should not be suggested in the Packages in Ubuntu
    portlet.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.