← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/testfix-unhide-comments into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/testfix-unhide-comments into lp:launchpad.

Commit message:
Make direct links to hidden comments work for their owners.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1391394 in Launchpad itself: "Unable to unhide my comment"
  https://bugs.launchpad.net/launchpad/+bug/1391394

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/testfix-unhide-comments/+merge/271043

Make direct links to hidden comments work for their owners.  Fixes xx-bug-hidden-comments test failure.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/testfix-unhide-comments into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py	2015-09-14 15:56:21 +0000
+++ lib/lp/bugs/browser/bugtask.py	2015-09-14 23:36:55 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2014 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2015 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """IBugTask-related browser views."""
@@ -385,6 +385,7 @@
             self.context, slice_info=[slice(index, index + 1)])
         if (comments and
             (comments[0].visible
+             or comments[0].owner == getUtility(ILaunchBag).user
              or check_permission('launchpad.Admin', self.context))):
             return comments[0]
         return None


Follow ups