forked from GithubBackups/healthchecks
Fix pricing link for logged in users.
This commit is contained in:
parent
813c316888
commit
0cf4c13f00
@ -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}
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user