Merge lp:~gmb/launchpad/bug-644346 into lp:launchpad

Proposed by Graham Binns
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 11618
Proposed branch: lp:~gmb/launchpad/bug-644346
Merge into: lp:launchpad
Diff against target: 21 lines (+4/-3)
1 file modified
lib/lp/bugs/browser/bugwatch.py (+4/-3)
To merge this branch: bzr merge lp:~gmb/launchpad/bug-644346
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Launchpad code reviewers code Pending
Review via email: mp+36143@code.launchpad.net

Commit message

When a bug watch is deleted, the success notification will be added to the response after the deletion happens rather than before.

Description of the change

This branch fixes bug 644346 by moving the code that adds the success notification for deleting a watch to *after* the point where the watch is deleted.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/browser/bugwatch.py'
--- lib/lp/bugs/browser/bugwatch.py 2010-08-27 10:00:21 +0000
+++ lib/lp/bugs/browser/bugwatch.py 2010-09-23 09:02:48 +0000
@@ -141,13 +141,14 @@
141 @action('Delete Bug Watch', name='delete', condition=bugWatchIsUnlinked)141 @action('Delete Bug Watch', name='delete', condition=bugWatchIsUnlinked)
142 def delete_action(self, action, data):142 def delete_action(self, action, data):
143 bugwatch = self.context143 bugwatch = self.context
144 self.request.response.addInfoNotification(144 # Build the notification first, whilst we still have the data.
145 structured(145 notification_message = structured(
146 'The <a href="%(url)s">%(bugtracker)s #%(remote_bug)s</a>'146 'The <a href="%(url)s">%(bugtracker)s #%(remote_bug)s</a>'
147 ' bug watch has been deleted.',147 ' bug watch has been deleted.',
148 url=bugwatch.url, bugtracker=bugwatch.bugtracker.name,148 url=bugwatch.url, bugtracker=bugwatch.bugtracker.name,
149 remote_bug=bugwatch.remotebug))149 remote_bug=bugwatch.remotebug)
150 bugwatch.bug.removeWatch(bugwatch, self.user)150 bugwatch.bug.removeWatch(bugwatch, self.user)
151 self.request.response.addInfoNotification(notification_message)
151152
152 def showResetActionCondition(self, action):153 def showResetActionCondition(self, action):
153 """Return True if the reset action can be shown to this user."""154 """Return True if the reset action can be shown to this user."""