forked from GithubBackups/healthchecks
Don't use Subscription.objects.for_user method here, so a subscription object is not created just by viewing a page.
This commit is contained in:
parent
93402c9c13
commit
636710f4f0
@ -17,5 +17,5 @@ class PricingTestCase(BaseTestCase):
|
|||||||
r = self.client.get("/pricing/")
|
r = self.client.get("/pricing/")
|
||||||
self.assertContains(r, "Unlimited Checks", status_code=200)
|
self.assertContains(r, "Unlimited Checks", status_code=200)
|
||||||
|
|
||||||
# A subscription object should have been created
|
# A subscription object still should have NOT been created
|
||||||
assert Subscription.objects.count() == 1
|
assert Subscription.objects.count() == 0
|
||||||
|
@ -30,7 +30,9 @@ def get_client_token(request):
|
|||||||
def pricing(request):
|
def pricing(request):
|
||||||
sub = None
|
sub = None
|
||||||
if request.user.is_authenticated():
|
if request.user.is_authenticated():
|
||||||
sub = Subscription.objects.for_user(request.user)
|
# Don't use Subscription.objects.for_user method here, so a
|
||||||
|
# subscription object is not created just by viewing a page.
|
||||||
|
sub = Subscription.objects.filter(user_id=request.user.id).first()
|
||||||
|
|
||||||
ctx = {
|
ctx = {
|
||||||
"page": "pricing",
|
"page": "pricing",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user