launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #20242
[Merge] lp:~cjwatson/launchpad/snap-delete-redirect-to-listing into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/snap-delete-redirect-to-listing into lp:launchpad.
Commit message:
Redirect to Person:+snaps rather than Person:+index after deleting a snap.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/snap-delete-redirect-to-listing/+merge/292257
Redirect to Person:+snaps rather than Person:+index after deleting a snap. I meant to do this when I initially implemented Snap:+delete, but I didn't have the snap listing views at the time.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/snap-delete-redirect-to-listing into lp:launchpad.
=== modified file 'lib/lp/snappy/browser/snap.py'
--- lib/lp/snappy/browser/snap.py 2016-02-28 17:23:53 +0000
+++ lib/lp/snappy/browser/snap.py 2016-04-19 10:33:47 +0000
@@ -518,6 +518,4 @@
def delete_action(self, action, data):
owner = self.context.owner
self.context.destroySelf()
- # XXX cjwatson 2015-07-17: This should go to Person:+snaps or
- # similar (or something on SnapSet?) once that exists.
- self.next_url = canonical_url(owner)
+ self.next_url = canonical_url(owner, view_name='+snaps')
=== modified file 'lib/lp/snappy/browser/tests/test_snap.py'
--- lib/lp/snappy/browser/tests/test_snap.py 2016-02-28 17:12:41 +0000
+++ lib/lp/snappy/browser/tests/test_snap.py 2016-04-19 10:33:47 +0000
@@ -1,4 +1,4 @@
-# Copyright 2015 Canonical Ltd. This software is licensed under the
+# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Test snap package views."""
@@ -591,7 +591,7 @@
browser = self.getViewBrowser(snap, user=self.person)
browser.getLink("Delete snap package").click()
browser.getControl("Delete snap package").click()
- self.assertEqual(owner_url, browser.url)
+ self.assertEqual(owner_url + "/+snaps", browser.url)
self.assertRaises(NotFound, browser.open, snap_url)
def test_delete_snap_with_builds(self):
@@ -605,7 +605,7 @@
browser = self.getViewBrowser(snap, user=self.person)
browser.getLink("Delete snap package").click()
browser.getControl("Delete snap package").click()
- self.assertEqual(owner_url, browser.url)
+ self.assertEqual(owner_url + "/+snaps", browser.url)
self.assertRaises(NotFound, browser.open, snap_url)
Follow ups