Merge lp:~wgrant/launchpad/bug-576168-no-disabled-latest-ppas into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: Michael Nelson
Approved revision: no longer in the source branch.
Merged at revision: 10839
Proposed branch: lp:~wgrant/launchpad/bug-576168-no-disabled-latest-ppas
Merge into: lp:launchpad
Diff against target: 33 lines (+12/-0)
2 files modified
lib/lp/soyuz/doc/archive.txt (+11/-0)
lib/lp/soyuz/model/archive.py (+1/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-576168-no-disabled-latest-ppas
Reviewer Review Type Date Requested Status
Michael Nelson (community) code Approve
Review via email: mp+24812@code.launchpad.net

Commit message

Don't display uploads to disabled PPAs in the latest upload list.

Description of the change

A trivial branch to exclude publications within disabled PPAs from the latest upload list. Since normal users can't see these PPAs, they can't see publications inside them, causing bug #576168.

There is no lint.

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Thanks William. I'll send it off to land.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/doc/archive.txt'
2--- lib/lp/soyuz/doc/archive.txt 2010-04-29 23:06:26 +0000
3+++ lib/lp/soyuz/doc/archive.txt 2010-05-06 10:41:29 +0000
4@@ -1786,6 +1786,17 @@
5 iceweasel 1.0 in breezy-autotest PUBLISHED mark
6 pmount 0.1-1 in warty PUBLISHED cprov
7
8+Publications in disabled archives are also excluded, since normal users
9+can't see them.
10+
11+ >>> login("admin@canonical.com")
12+ >>> cprov_cdrkit.archive.disable()
13+ >>> print_latest_uploads()
14+ cdrkit 1.0 in hoary PENDING mark
15+ iceweasel 1.0 in hoary PENDING mark
16+ iceweasel 1.0 in breezy-autotest PUBLISHED mark
17+ >>> cprov_cdrkit.archive.enable()
18+
19 'getMostActivePPAsForDistribution' returns a list of dictionaries
20 containing up to 5 PPAs with the highest number of publications in the
21 last 7 days. Each dictionary contains the following keys:
22
23=== modified file 'lib/lp/soyuz/model/archive.py'
24--- lib/lp/soyuz/model/archive.py 2010-05-03 07:32:58 +0000
25+++ lib/lp/soyuz/model/archive.py 2010-05-06 10:41:29 +0000
26@@ -1681,6 +1681,7 @@
27 SourcePackagePublishingHistory.distroseries =
28 DistroSeries.id AND
29 Archive.private = FALSE AND
30+ Archive.enabled = TRUE AND
31 DistroSeries.distribution = %s AND
32 Archive.purpose = %s
33 """ % sqlvalues(distribution, ArchivePurpose.PPA)