Merge lp:~cjwatson/launchpad/gitref-activereviews-oops into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 17760
Proposed branch: lp:~cjwatson/launchpad/gitref-activereviews-oops
Merge into: lp:launchpad
Diff against target: 61 lines (+19/-11)
2 files modified
lib/lp/code/browser/branchmergeproposallisting.py (+1/-1)
lib/lp/code/browser/tests/test_branchmergeproposallisting.py (+18/-10)
To merge this branch: bzr merge lp:~cjwatson/launchpad/gitref-activereviews-oops
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+272404@code.launchpad.net

Commit message

Fix GitRef:+activereviews OOPS when there are no active reviews.

Description of the change

Fix GitRef:+activereviews OOPS when there are no active reviews.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/code/browser/branchmergeproposallisting.py'
--- lib/lp/code/browser/branchmergeproposallisting.py 2015-07-09 20:06:17 +0000
+++ lib/lp/code/browser/branchmergeproposallisting.py 2015-09-25 14:23:24 +0000
@@ -408,7 +408,7 @@
408 @property408 @property
409 def no_proposal_message(self):409 def no_proposal_message(self):
410 """Shown when there is no table to show."""410 """Shown when there is no table to show."""
411 return "%s has no active code reviews." % self.context.displayname411 return "%s has no active code reviews." % self.context.display_name
412412
413413
414class BranchActiveReviewsView(ActiveReviewsView):414class BranchActiveReviewsView(ActiveReviewsView):
415415
=== modified file 'lib/lp/code/browser/tests/test_branchmergeproposallisting.py'
--- lib/lp/code/browser/tests/test_branchmergeproposallisting.py 2015-06-30 02:10:48 +0000
+++ lib/lp/code/browser/tests/test_branchmergeproposallisting.py 2015-09-25 14:23:24 +0000
@@ -500,11 +500,19 @@
500 """Test the sorting of the active review groups for Git."""500 """Test the sorting of the active review groups for Git."""
501501
502502
503class ActiveReviewsWithPrivateBranchesMixin:503class ActiveReviewsOfBranchesMixin:
504 """Test reviews of private branches."""504 """Test reviews of branches."""
505505
506 layer = DatabaseFunctionalLayer506 layer = DatabaseFunctionalLayer
507507
508 def test_no_proposal_message(self):
509 branch = self._makeBranch()
510 view = create_initialized_view(
511 branch, name='+activereviews', rootsite='code')
512 self.assertEqual(
513 "%s has no active code reviews." % branch.display_name,
514 view.no_proposal_message)
515
508 def test_private_branch_owner(self):516 def test_private_branch_owner(self):
509 # Merge proposals against private branches are visible to517 # Merge proposals against private branches are visible to
510 # the branch owner.518 # the branch owner.
@@ -518,14 +526,14 @@
518 self.assertEqual([mp], list(view.getProposals()))526 self.assertEqual([mp], list(view.getProposals()))
519527
520528
521class ActiveReviewsWithPrivateBranchesBzr(529class ActiveReviewsOfBranchesBzr(
522 ActiveReviewsWithPrivateBranchesMixin, BzrMixin, TestCaseWithFactory):530 ActiveReviewsOfBranchesMixin, BzrMixin, TestCaseWithFactory):
523 """Test reviews of private Bazaar branches."""531 """Test reviews of Bazaar branches."""
524532
525533
526class ActiveReviewsWithPrivateBranchesGit(534class ActiveReviewsOfBranchesGit(
527 ActiveReviewsWithPrivateBranchesMixin, GitMixin, TestCaseWithFactory):535 ActiveReviewsOfBranchesMixin, GitMixin, TestCaseWithFactory):
528 """Test reviews of references in private Git repositories."""536 """Test reviews of references in Git repositories."""
529537
530538
531class PersonActiveReviewsPerformanceMixin:539class PersonActiveReviewsPerformanceMixin: