Merge lp:~gmb/launchpad/lp-devs-can-reset-watches into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Graham Binns |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11462 |
Proposed branch: | lp:~gmb/launchpad/lp-devs-can-reset-watches |
Merge into: | lp:launchpad |
Diff against target: |
339 lines (+212/-3) 8 files modified
lib/canonical/launchpad/security.py (+11/-0) lib/lp/bugs/browser/bugwatch.py (+17/-0) lib/lp/bugs/configure.zcml (+5/-2) lib/lp/bugs/interfaces/bugwatch.py (+11/-0) lib/lp/bugs/model/bugwatch.py (+9/-0) lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt (+67/-0) lib/lp/bugs/templates/bugwatch-portlet-details.pt (+1/-1) lib/lp/bugs/tests/test_bugwatch.py (+91/-0) |
To merge this branch: | bzr merge lp:~gmb/launchpad/lp-devs-can-reset-watches |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+33796@code.launchpad.net |
Commit message
A button has been added to bug watch pages to allow admins to completely reset a bug watch.
Description of the change
This branch adds a button to the BugWatch +edit page, visible to LP devs and admins. The button allows the user to completely reset the bug watch so that checkwatches treats it as a brand new watch. This is distinct from the "reschedule this watch" button, which merely re-queues the watch for updating.
I've added a new AuthorizationBase for IBugWatch, defining the people who have launchpad.Admin permission on a BugWatch as Admins and Launchpad developers.
I've added a reset() method to BugWatch and a related action to BugWatchEditView. I've added unittests for BugWatch.reset() to lp.bugs.
Hi Graham,
nice work! Just one suggestion:
> === modified file 'lib/lp/ bugs/browser/ bugwatch. py' bugs/browser/ bugwatch. py 2010-08-20 20:31:18 +0000 bugs/browser/ bugwatch. py 2010-08-26 15:46:37 +0000 launchpad. webapp. authorization import check_permission launchpad. webapp. interfaces import ILaunchBag launchpad. webapp. menu import structured widgets. textwidgets import URIWidget bug=bugwatch. remotebug) ) bug.removeWatch (bugwatch, self.user) ndition( self, action): n('launchpad. Admin', self.context)
> --- lib/lp/
> +++ lib/lp/
> @@ -25,6 +25,7 @@
> LaunchpadFormView,
> LaunchpadView,
> )
> +from canonical.
> from canonical.
> from canonical.
> from canonical.
> @@ -148,6 +149,22 @@
> remote_
> bugwatch.
>
> + def resetBugWatchCo
> + """Return True if the reset action can be shown to this user."""
> + return check_permissio
> +
Perhaps I did not have enough coffee, but I think this method name could also mean "is the bug watch in a state that it could/should be reset?". What about "userCanResetBu gWatch" ?