Browse Source

Fix pricing link for logged in users.

pull/60/head
Pēteris Caune 9 years ago
parent
commit
0cf4c13f00
2 changed files with 7 additions and 1 deletions
  1. +1
    -1
      hc/payments/context_processors.py
  2. +6
    -0
      hc/payments/tests/test_pricing.py

+ 1
- 1
hc/payments/context_processors.py View File

@ -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}

+ 6
- 0
hc/payments/tests/test_pricing.py View File

@ -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="[email protected]", password="password")
r = self.client.get("/about/")
self.assertContains(r, "Pricing")

Loading…
Cancel
Save