← Back to team overview

launchpad-reviewers team mailing list archive

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

 

William Grant has proposed merging lp:~wgrant/launchpad/hide-deleted-ppas into lp:launchpad.

Commit message:
Hide deleted PPAs from Person:+index.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #604877 in Launchpad itself: "Deleting a PPA does not remove the PPA's Launchpad page"
  https://bugs.launchpad.net/launchpad/+bug/604877
  Bug #908393 in Launchpad itself: "Hide deleted PPAs from my damn user page!"
  https://bugs.launchpad.net/launchpad/+bug/908393

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/hide-deleted-ppas/+merge/149737

Hide deleted PPAs from Person:+index. Pretty simple.
-- 
https://code.launchpad.net/~wgrant/launchpad/hide-deleted-ppas/+merge/149737
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/hide-deleted-ppas into lp:launchpad.
=== modified file 'lib/lp/registry/interfaces/person.py'
--- lib/lp/registry/interfaces/person.py	2012-12-10 20:49:43 +0000
+++ lib/lp/registry/interfaces/person.py	2013-02-21 02:06:21 +0000
@@ -1052,7 +1052,7 @@
         """
 
     def getVisiblePPAs(user):
-        """Return the PPAs for which user has launchpad.View permission."""
+        """Return active PPAs for which user has launchpad.View permission."""
 
     def getInvitedMemberships():
         """Return all TeamMemberships of this team with the INVITED status.

=== modified file 'lib/lp/registry/model/person.py'
--- lib/lp/registry/model/person.py	2013-01-22 05:59:13 +0000
+++ lib/lp/registry/model/person.py	2013-02-21 02:06:21 +0000
@@ -3076,6 +3076,8 @@
         return Store.of(self).find(
             Archive,
             Archive.owner == self,
+            Archive.status.is_in(
+                (ArchiveStatus.ACTIVE, ArchiveStatus.DELETING)),
             filter).order_by(Archive.name)
 
     def getPPAByName(self, name):

=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt'
--- lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt	2013-02-20 04:02:00 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt	2013-02-21 02:06:21 +0000
@@ -694,6 +694,20 @@
     ...
     Unauthorized: ...
 
+Deleted PPAs don't even show up for the owner.
+
+    >>> from lp.soyuz.enums import ArchiveStatus
+    >>> login('admin@xxxxxxxxxxxxx')
+    >>> cprov = getUtility(IPersonSet).getByName('cprov')
+    >>> cprov.getPPAByName('edge').status = ArchiveStatus.DELETED
+    >>> logout()
+
+    >>> cprov_browser.open("http://launchpad.dev/~cprov";)
+    >>> print_tag_with_id(cprov_browser.contents, 'ppas')
+    Personal package archives
+    PPA for Celso Providelo
+    Create a new PPA
+
 
 Enabling or disabling of PPAs by the owner
 ------------------------------------------