diff --git a/hc/payments/context_processors.py b/hc/payments/context_processors.py index e9e67a1f..d093d25e 100644 --- a/hc/payments/context_processors.py +++ b/hc/payments/context_processors.py @@ -6,7 +6,7 @@ def payments(request): show_pricing = settings.USE_PAYMENTS if show_pricing and request.user.is_authenticated(): profile = request.user.profile - if profile.id != profile.current_team_id: + if profile.current_team_id and profile.current_team_id != profile.id: show_pricing = False return {'show_pricing': show_pricing} diff --git a/hc/payments/tests/test_pricing.py b/hc/payments/tests/test_pricing.py index 5d17dded..a776fc4c 100644 --- a/hc/payments/tests/test_pricing.py +++ b/hc/payments/tests/test_pricing.py @@ -27,3 +27,9 @@ class PricingTestCase(BaseTestCase): # Bob should not see pricing tab, as bob is currently on # Alice's team, but is not its owner. self.assertNotContains(r, "Pricing") + + def test_pricing_is_visible_for_team_owners(self): + self.client.login(username="alice@example.org", password="password") + + r = self.client.get("/about/") + self.assertContains(r, "Pricing")