← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~gmb/launchpad/bug-644346 into lp:launchpad/devel

 

Graham Binns has proposed merging lp:~gmb/launchpad/bug-644346 into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): code
Related bugs:
  #644346 BugWatchEditView.delete_action adds the confirmation notification before actually deleting the watch
  https://bugs.launchpad.net/bugs/644346


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.
-- 
https://code.launchpad.net/~gmb/launchpad/bug-644346/+merge/36143
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~gmb/launchpad/bug-644346 into lp:launchpad/devel.
=== 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-21 13:38:43 +0000
@@ -141,13 +141,14 @@
     @action('Delete Bug Watch', name='delete', condition=bugWatchIsUnlinked)
     def delete_action(self, action, data):
         bugwatch = self.context
-        self.request.response.addInfoNotification(
-            structured(
+        # Build the notification first, whilst we still have the data.
+        notification_message = structured(
             'The <a href="%(url)s">%(bugtracker)s #%(remote_bug)s</a>'
             ' bug watch has been deleted.',
             url=bugwatch.url, bugtracker=bugwatch.bugtracker.name,
-            remote_bug=bugwatch.remotebug))
+            remote_bug=bugwatch.remotebug)
         bugwatch.bug.removeWatch(bugwatch, self.user)
+        self.request.response.addInfoNotification(notification_message)
 
     def showResetActionCondition(self, action):
         """Return True if the reset action can be shown to this user."""


Follow ups