Merge lp:~wgrant/launchpad/hide-deleted-ppas into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 16504
Proposed branch: lp:~wgrant/launchpad/hide-deleted-ppas
Merge into: lp:launchpad
Diff against target: 50 lines (+17/-1)
3 files modified
lib/lp/registry/interfaces/person.py (+1/-1)
lib/lp/registry/model/person.py (+2/-0)
lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt (+14/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/hide-deleted-ppas
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Review via email: mp+149737@code.launchpad.net

Commit message

Hide deleted PPAs from Person:+index.

Description of the change

Hide deleted PPAs from Person:+index. Pretty simple.

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) :
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/registry/interfaces/person.py'
2--- lib/lp/registry/interfaces/person.py 2012-12-10 20:49:43 +0000
3+++ lib/lp/registry/interfaces/person.py 2013-02-21 02:06:21 +0000
4@@ -1052,7 +1052,7 @@
5 """
6
7 def getVisiblePPAs(user):
8- """Return the PPAs for which user has launchpad.View permission."""
9+ """Return active PPAs for which user has launchpad.View permission."""
10
11 def getInvitedMemberships():
12 """Return all TeamMemberships of this team with the INVITED status.
13
14=== modified file 'lib/lp/registry/model/person.py'
15--- lib/lp/registry/model/person.py 2013-01-22 05:59:13 +0000
16+++ lib/lp/registry/model/person.py 2013-02-21 02:06:21 +0000
17@@ -3076,6 +3076,8 @@
18 return Store.of(self).find(
19 Archive,
20 Archive.owner == self,
21+ Archive.status.is_in(
22+ (ArchiveStatus.ACTIVE, ArchiveStatus.DELETING)),
23 filter).order_by(Archive.name)
24
25 def getPPAByName(self, name):
26
27=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt'
28--- lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2013-02-20 04:02:00 +0000
29+++ lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2013-02-21 02:06:21 +0000
30@@ -694,6 +694,20 @@
31 ...
32 Unauthorized: ...
33
34+Deleted PPAs don't even show up for the owner.
35+
36+ >>> from lp.soyuz.enums import ArchiveStatus
37+ >>> login('admin@canonical.com')
38+ >>> cprov = getUtility(IPersonSet).getByName('cprov')
39+ >>> cprov.getPPAByName('edge').status = ArchiveStatus.DELETED
40+ >>> logout()
41+
42+ >>> cprov_browser.open("http://launchpad.dev/~cprov")
43+ >>> print_tag_with_id(cprov_browser.contents, 'ppas')
44+ Personal package archives
45+ PPA for Celso Providelo
46+ Create a new PPA
47+
48
49 Enabling or disabling of PPAs by the owner
50 ------------------------------------------